【发布时间】:2016-02-16 07:25:27
【问题描述】:
我正在尝试使用 Maven 在 Eclipse 中设置一个 Maven 项目。到目前为止我尝试过的:
- 在 Eclipse 中通过创建新的 Maven 项目并选择 2.7.0 版中的 org.codehouse.mojo gwt-maven-plugin 来创建项目。
问题: - Eclispe 不提供任何运行配置
所以我转到项目的属性,转到 Google 选项卡,将 Eclipse 指向 webapp 文件夹并检查显示“使用 Google Web Toolkit”的 chedkbox。
之后,Eclipse 确实将我的项目识别为 GWT 项目,但是,它在我的构建路径中添加了几个 jar(我认为这不是必需的,因为我使用的是 Maven,并且同一个 jar 已经被列为 maven依赖项),当我在超级开发模式下运行它时,我得到了这个错误:
Missing required argument 'module[s]'
Google Web Toolkit 2.7.0
另外,当我右键单击并选择 Google > GWT Compile 时,它告诉我我的项目不是 GWT 项目。
-
我使用命令行创建了项目:
mvn 原型:生成
org.codehaus.mojo:gwt-maven-plugin
选择原型:
1:远程 -> org.codehaus.mojo:gwt-maven-plugin(Google Web Toolkit 的 Maven 插件。)
选择一个数字或应用过滤器(格式:[groupId:]artifactId,包含区分大小写)::1
org.codehaus.mojo:gwt-maven-plugin 版本:
23: 2.7.0
项目成功生成,我将它作为maven项目导入Eclipse。同样,Eclipse 不会将其识别为 GWT 项目。
- 我想从这里创建一个具有 2.8.0 原型的项目:
https://gwt-maven-plugin.github.io/gwt-maven-plugin/user-guide/archetype.html
但是,我收到此错误:
mvn archetype:generate -DarchetypeGroupId=org.codehaus.mojo -DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.8.0-SNAPSHOT
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.4:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.4:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:2.4:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] Archetype repository not defined. Using the one from [org.codehaus.mojo:gwt-maven-plugin:2.7.0] found in catalog remote
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17.449 s
[INFO] Finished at: 2015-11-14T23:47:50+01:00
[INFO] Final Memory: 13M/182M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:generate (default-cli) on project standalone-pom: The desired archetype does not exist (org.codehaus.mojo:gwt-ma
ven-plugin:2.8.0-SNAPSHOT) -> [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/MojoFailureException
我到底做错了什么?
【问题讨论】: