java - 创建新的maven项目指南

标签 java maven vaadin7

我正要创建一个新的 Maven 项目,并遇到了这个有趣的指南 https://vaadin.com/wiki/-/wiki/Main/Creating%20a%20simple%20component 现在,我有几个关于让它与 Maven 项目一起工作的问题,因为处理方式似乎存在一些差异。

  1. 当我创建 Maven 项目时,我没有得到文章末尾描述的相同结构:

    com.example.mycomponent
       MyComponent.java
       MyComponentWidgetset.gwt.xml
    com.example.mycomponent.client
       MyComponentConnector.java
       MyComponentWidget.java
    

    这正常吗?这是否意味着我必须修改maven中的结构?

  2. 他们似乎不是在谈论 pom.xml 文件,而是在谈论 web.xml,它们是同一件事吗?

一般来说,我想做的是创建一个新的 Maven 项目并按照本教程进行操作

最佳答案

Vaadin 和 Maven 是两个不同的东西。

Vaadin 是一个用于构建现代 Web 应用程序的 Java 框架,然后您可以通过 POM.xml 将其导入到 Maven 项目中:

<dependency>
    <groupId>com.vaadin</groupId>
    <artifactId>vaadin-server</artifactId>
    <version>7.6.6</version>
</dependency>
<dependency>
    <groupId>com.vaadin</groupId>
    <artifactId>vaadin-client-compiled</artifactId>
    <version>7.6.6</version>
</dependency>

<!-- Optional for extending client-side See: https://vaadin.com/book/-/page/clientside.html
<dependency>
    <groupId>com.vaadin</groupId>
    <artifactId>vaadin-client</artifactId>
    <version>7.6.6</version>
    <scope>provided</scope>
</dependency>
-->

<!-- Optional for optimizing client-side widgets See: https://vaadin.com/book/-/page/mobile.optimization.html
<dependency>
    <groupId>com.vaadin</groupId>
    <artifactId>vaadin-client-compiler</artifactId>
    <version>7.6.6</version>
    <scope>provided</scope>
</dependency>
-->

<dependency>
    <groupId>com.vaadin</groupId>
    <artifactId>vaadin-themes</artifactId>
    <version>7.6.6</version>
</dependency>

<!-- Optional push support for communication See: https://vaadin.com/book/-/page/advanced.push.html
<dependency>
    <groupId>com.vaadin</groupId>
    <artifactId>vaadin-push</artifactId>
    <version>7.6.6</version>
</dependency>
-->

来源https://vaadin.com/maven#dependencies

要使用 Maven 创建 Vaadin 项目,请检查此 tutorial

Maven’s primary goal is to allow a developer to comprehend the complete state of a development effort in the shortest period of time. In order to attain this goal there are several areas of concern that Maven attempts to deal with:

  1. Making the build process easy

  2. Providing a uniform build system

  3. Providing quality project information

  4. Providing guidelines for best practices development

  5. Allowing transparent migration to new features

Source: maven

关于java - 创建新的maven项目指南,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37724072/

相关文章:

maven - 替换 Maven 3 中的 plexus 组件

spring - Vaadin 7.1 + Spring-Security 集成在 Tomcat 服务器中运行

java - 如何使用 JSch 访问 FTP 服务器?

java - Infinispan 从数据库表预加载数据

java - Optional 的 `orElse` 惰性评估失败导致性能下降

java - 由 : java. lang.ClassNotFoundException : org. slf4j.LoggerFactory 引起

java - 找出有多少 Runnables 在 EventQueue 上等待

java - Maven 项目安装到 jar,尝试访问路径时出现 404

java - 使用 Vaadin 登录的 Spring Boot 安全性

css - 无法在我的 vaadin 元素中使用自定义主题