[英]Setting up GWT project with maven in Eclipse
我试图使用Maven在Eclipse中建立一个Maven项目。 到目前为止我尝试过的是:
问题:-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工具包的Maven插件。)
选择一个数字或应用过滤器(格式:[groupId:] artifactId,区分大小写):: 1
org.codehaus.mojo:gwt-maven-plugin版本:
23:2.7.0
该项目已成功生成,我将其作为maven项目导入了Eclipse。 同样,Eclipse不会将其识别为GWT项目。
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
我到底在做什么错?
请尝试一下:
mvn archetype:generate -DarchetypeGroupId=org.codehaus.mojo -DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.8.0
使用最新的Google GWT插件在Jdk 1.7和Maven 3.3.9环境以及Eclipse Mars中进行了测试。
您使用的gwt maven插件版本错误。 2.8.0-SNAPSHOT版本在maven存储库中不可用。
请参阅下面的链接以在maven存储库中找到插件的发行版本。 http://mvnrepository.com/artifact/org.codehaus.mojo/gwt-maven-plugin
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.