首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >gwt-maven-plugin在gwt-app上失败

gwt-maven-plugin在gwt-app上失败
EN

Stack Overflow用户
提问于 2018-07-19 20:03:42
回答 1查看 566关注 0票数 2

我在获取gwt-maven-plugin时遇到了一些问题,就像文档所说的那样。使用GWT2.8.2使用InteliJ 2018从从2.8.2 webAppCreator生成的示例项目开始,模板为maven,sample,readme。

该基本项目已将打包设置为war

代码语言:javascript
复制
<!-- 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),它就失败了。

代码语言:javascript
复制
[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]

对这个问题有什么想法吗?

谢谢

EN

回答 1

Stack Overflow用户

发布于 2018-07-20 01:58:08

您可能错过了插件中的<extensions>true</extensions>

请注意,gwt-app只是客户端代码,根本不是服务器端代码。我建议使用https://github.com/tbroyer/gwt-maven-archetypes而不是webAppCreator作为起点。modular webapp原型在功能上与webAppCreator生成的示例项目相同,但采用了更面向Maven的设置。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51422246

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档