Vaadin 8 构建的应用程序(WAR 文件或其他工件)存储在 IntelliJ 2017 中的什么位置?

Where is Vaadin 8 built app (WAR file or other artifacts) being stored in IntelliJ 2017?

创建 Vaadin app via the simple Maven 原型时:

mvn -B archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetype-application -DarchetypeVersion=8.0.6 -DgroupId=org.test -DartifactId=vaadin-app -Dversion=1.0-SNAPSHOT

…和 运行 通过捆绑的 Jetty servlet container, where is my built web app being stored? Is there a WAR file 生成?如果有,在哪里?


我在 macOS Sierra 10.12.5 和 IntelliJ 2017.1.3 上使用 Java 8 Update 131。

target 文件夹中 mvn install

之后

在Maven中执行mvn install后,会在"target"文件夹中找到.war文件

例如……查看名为 TryAgain 的项目的屏幕截图,其中文件夹 target 包含名为 tryagain-1.0-SNAPSHOT.war.

的 WAR 文件

据我所知,正如文档所建议的,当 运行 mvn jetty:run 时,没有构建工件。相反,使用它自己的内部机制,maven jetty 插件将从 target\classes

(重新)加载你编译的 类

The run goal runs on a webapp that does not have to be built into a WAR. Instead, Jetty deploys the webapp from its sources. It looks for the constituent parts of a webapp in the Maven default project locations, although you can override these in the plugin configuration. For example, by default it looks for:

  • resources in ${project.basedir}/src/main/webapp
  • classes in ${project.build.outputDirectory}
  • web.xml in ${project.basedir}/src/main/webapp/WEB-INF/

The plugin automatically ensures the classes are rebuilt and up-to-date before deployment. If you change the source of a class and your IDE automatically compiles it in the background, the plugin picks up the changed class.

You do not need to assemble the webapp into a WAR, saving time during the development cycle. Once invoked, you can configure the plugin to run continuously, scanning for changes in the project and automatically performing a hot redeploy when necessary. Any changes you make are immediately reflected in the running instance of Jetty, letting you quickly jump from coding to testing, rather than going through the cycle of: code, compile, reassemble, redeploy, test.

... 和 (may) use the dependencies from the maven repo:

*Note The classpath of the running Jetty instance and its deployed webapp are managed by Maven, and may not be exactly what you expect. For example: a webapp’s dependent jars might be referenced via the local repository, not the WEB-INF/lib directory.

上面提到的一些信息也可以在日志中观察到,当 运行 插件(运行 maven with -X aka debug output on,提供更多信息):

[INFO] Configuring Jetty for project: vaadin-app
[INFO] webAppSourceDirectory not set. Trying src\main\webapp
[INFO] Reload Mechanic: automatic
[INFO] Classes = D:\tmp\test\vaadin-app\target\classes
[DEBUG] Starting Jetty Server ...
[INFO] Context path = /
[INFO] Tmp directory = D:\tmp\test\vaadin-app\target\tmp
[INFO] Web defaults = org/eclipse/jetty/webapp/webdefault.xml
[INFO] Web overrides =  none
[DEBUG] Adding artifact vaadin-server-8.0.6.jar with scope compile for WEB-INF/lib 
[DEBUG] Adding artifact vaadin-sass-compiler-0.9.13.jar with scope compile for WEB-INF/lib 
[DEBUG] Adding artifact sac-1.3.jar with scope compile for WEB-INF/lib 
[DEBUG] Adding artifact flute-1.3.0.gg2.jar with scope compile for WEB-INF/lib 
[DEBUG] Adding artifact vaadin-shared-8.0.6.jar with scope compile for WEB-INF/lib 
[DEBUG] Adding artifact jsoup-1.8.3.jar with scope compile for WEB-INF/lib 
[DEBUG] Adding artifact gentyref-1.2.0.jar with scope compile for WEB-INF/lib 
[DEBUG] Adding artifact vaadin-push-8.0.6.jar with scope compile for WEB-INF/lib 
[DEBUG] Adding artifact atmosphere-runtime-2.4.5.vaadin2.jar with scope compile for WEB-INF/lib 
[DEBUG] Adding artifact vaadin-slf4j-jdk14-1.6.1.jar with scope compile for WEB-INF/lib 
[DEBUG] Adding artifact vaadin-client-compiled-8.0.6.jar with scope compile for WEB-INF/lib 
[DEBUG] Adding artifact vaadin-themes-8.0.6.jar with scope compile for WEB-INF/lib 
[INFO] web.xml file = null
[INFO] Webapp directory = D:\tmp\test\vaadin-app\src\main\webapp
[INFO] Started Jetty Server

但是,如果您想要构建和部署打包的 war 或分解的,您可以使用 jetty:run-war:

This goal first packages your webapp as a WAR file and then deploys it to Jetty. If you set a non-zero scanInterval, Jetty watches your pom.xml and the WAR file; if either changes, it redeploys the war.

... and/or jetty:run-exploded:

The run-exploded goal first assembles your webapp into an exploded WAR file and then deploys it to Jetty. If you set a non-zero scanInterval, Jetty watches your pom.xml,`WEB-INF/lib, WEB-INF/ and WEB-INF/web.xml for changes and redeploys when necessary.

Maven War Plugin 用法文档的详细信息指出:

正在调用

mvn package

mvn compile war:war

应生成 WAR 文件 target/vaadin-app-1.0-SNAPSHOT.war


另外链接 vaadin-docs 这也表明在执行 mvn package

之后
The location of the resulting WAR package should be displayed in the command output.