我正要创建一个新的 Maven 项目,并遇到了这个有趣的指南 https://vaadin.com/wiki/-/wiki/Main/Creating%20a%20simple%20component 现在,我有几个关于让它与 Maven 项目一起工作的问题,因为处理方式似乎存在一些差异。
当我创建 Maven 项目时,我没有得到文章末尾描述的相同结构:
com.example.mycomponent MyComponent.java MyComponentWidgetset.gwt.xml com.example.mycomponent.client MyComponentConnector.java MyComponentWidget.java
这正常吗?这是否意味着我必须修改maven中的结构?
他们似乎不是在谈论 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:
Making the build process easy
Providing a uniform build system
Providing quality project information
Providing guidelines for best practices development
Allowing transparent migration to new features
Source: maven
关于java - 创建新的maven项目指南,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37724072/