2

我在让 gwt-maven-plugin 像文档所说的那样工作时遇到问题。使用 GWT 2.8.2 使用 InteliJ 2018 从使用模板 maven、sample、readme 的 2.8.2 webAppCreator 生成的示例项目开始。

那个基本项目的包装设置为战争

<!-- 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]

关于这个问题的任何想法?

谢谢

4

1 回答 1

1

您可能缺少<extensions>true</extensions>插件中的 。

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

于 2018-07-19T17:58:07.710 回答