【发布时间】:2018-01-06 14:11:10
【问题描述】:
当使用原型 vaadin-archetype-application-multimodule 创建名为 bogus 的新 Vaadin 8.1.0 应用程序时,在 IntelliJ 2017.2 中运行 Maven 项目面板 > bogus-ui > 插件 > jetty > jetty:run 时构建失败
我在控制台上收到这些错误消息。
/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/bin/java -Dmaven.multiModuleProjectDirectory=/Users/basilbourque/IdeaProjects/bogus/bogus-ui "-Dmaven.home=/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3" "-Dclassworlds.conf=/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3/bin/m2.conf" "-javaagent:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=55637:/Applications/IntelliJ IDEA.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3/boot/plexus-classworlds-2.5.2.jar" org.codehaus.classworlds.Launcher -Didea.version=2017.2 org.eclipse.jetty:jetty-maven-plugin:9.3.9.v20160517:run
objc[11304]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/bin/java (0x1060bd4c0) and /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x10712c4e0). One of the two will be used. Which one is undefined.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building bogus-ui 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> jetty-maven-plugin:9.3.9.v20160517:run (default-cli) > test-compile @ bogus-ui >>>
Downloading: http://maven.vaadin.com/vaadin-addons/com/example/bogus-backend/1.0-SNAPSHOT/maven-metadata.xml
Downloading: http://maven.vaadin.com/vaadin-addons/com/example/bogus-backend/1.0-SNAPSHOT/bogus-backend-1.0-SNAPSHOT.pom
[WARNING] The POM for com.example:bogus-backend:jar:1.0-SNAPSHOT is missing, no dependency information available
Downloading: http://maven.vaadin.com/vaadin-addons/com/example/bogus-backend/1.0-SNAPSHOT/bogus-backend-1.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.334 s
[INFO] Finished at: 2017-07-30T22:58:18-07:00
[INFO] Final Memory: 11M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project bogus-ui: Could not resolve dependencies for project com.example:bogus-ui:war:1.0-SNAPSHOT: Could not find artifact com.example:bogus-backend:jar:1.0-SNAPSHOT in vaadin-addons (http://maven.vaadin.com/vaadin-addons) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
Process finished with exit code 1
在带有 IntelliJ Ultimate 版本 2017.2 的 macOS Sierra 10.12.5 上使用 Java 8 Update 144。
链接的问题Maven: How to use jetty:run in a multi-module Maven project, without needing to install,不是此问题的副本。那个人询问一个模块(Web 模块)获取其他模块中所做的更改并导致重建,而不是从本地存储库中检索构建的项目。我首先要问的是如何在需要触发重新构建之前运行该应用程序。
【问题讨论】:
-
@Morfic 不是重复的,但that other Question 非常有趣且乐于助人,谢谢。 this one on multimodule Maven best practices也是如此。
-
没问题。我认为您在父级上运行了
mvn install,然后在mvn jetty:run上运行,您仍然遇到同样的问题? -
@Morfic 正在工作。在根/父模块上运行
Lifecycle>install就可以了,然后运行 Plugins>Jetty:run来运行 Vaadin 应用程序。我在这里编辑并接受了答案。下一步是学习如何从 IntelliJ 正确运行 Vaadin Web 应用程序,因为我读到Jetty:run是为了方便,但不是最适合日常增量开发工作。 -
酷,但我觉得它仍然是提到的问题的重复,因为想法是一样的。要运行依赖于其他模块的模块,您需要在本地 repo 中安装所有这些依赖项,而不是码头根据您的 maven 项目结构拾取它们(或它们的类)。此外,正如您所说,一旦您进行更改,您将不得不重新安装更新的模块(或者如果跨多个模块发生更改,则重新安装所有模块)。不管是在项目初期还是后期,还是需要先运行
install,但这只是我个人的看法。
标签: maven build vaadin maven-archetype vaadin8