我在获取gwt-maven-plugin时遇到了一些问题,就像文档所说的那样。使用GWT2.8.2使用InteliJ 2018从从2.8.2 webAppCreator生成的示例项目开始,模板为maven,sample,readme。
该基本项目已将打包设置为war
<!-- POM file generated with GWT webAppCreator -->
<modelVersion>4.0.0</modelVersion>
<groupId>org.gwtproject.tutorial</groupId>
<artifactId>TodoList</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>org.gwtproject.tutorial.TodoList</name>
The gwt-maven-plugin is set to 1.0-rc-8
<!-- GWT Maven Plugin-->
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.0-rc-8</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<moduleName>org.gwtproject.tutorial.TodoList</moduleName>
<moduleShortName>TodoList</moduleShortName>
<failOnError>true</failOnError>
<!-- GWT compiler 2.8 requires 1.8, hence define sourceLevel here if you use
a different source language for java compilation -->
<sourceLevel>1.8</sourceLevel>
<!-- Compiler configuration -->
<compilerArgs>
<!-- Ask GWT to create the Story of Your Compile (SOYC) (gwt:compile) -->
<arg>-compileReport</arg>
<arg>-XcompilerMetrics</arg>
</compilerArgs>
<!-- DevMode configuration -->
<warDir>${project.build.directory}/${project.build.finalName}</warDir>
<classpathScope>compile+runtime</classpathScope>
<!-- URL(s) that should be opened by DevMode (gwt:devmode). -->
<startupUrls>
<startupUrl>TodoList.html</startupUrl>
</startupUrls>
</configuration>
</plugin>此时,我可以在DEV模式下运行。一旦我将打包更改为gwt-app (根据插件文档的https://tbroyer.github.io/gwt-maven-plugin/usage.html),它就失败了。
[ERROR] Unknown packaging: gwt-app @ line 9, column 14
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.gwtproject.tutorial:TodoList:1.0-SNAPSHOT (D:\ToDoList\pom.xml) has 1 error
[ERROR] Unknown packaging: gwt-app @ line 9, column 14
[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]对这个问题有什么想法吗?
谢谢
发布于 2018-07-20 01:58:08
您可能错过了插件中的<extensions>true</extensions>。
请注意,gwt-app只是客户端代码,根本不是服务器端代码。我建议使用https://github.com/tbroyer/gwt-maven-archetypes而不是webAppCreator作为起点。modular webapp原型在功能上与webAppCreator生成的示例项目相同,但采用了更面向Maven的设置。
https://stackoverflow.com/questions/51422246
复制相似问题