如何通过 GWT 项目使用 Maven 配置文件更改 GWT.xml

Kay*_*ser 5 profile gwt maven

目前,我正在开发一个 gwt-maven 项目。与每个 GWT 项目一样,它都有以下 gwt.xml

<module rename-to='myProject'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' />
   .
   .    
   ...
Run Code Online (Sandbox Code Playgroud)

我创建了另一个 gwt.xml 来设置持续集成的配置。(如此处所定义。)

<module rename-to='myProject'>
    <!-- Inherit the core Web Toolkit stuff. -->
    <inherits name='com.myCompany.myProject' />
   .
   .    
   ...
Run Code Online (Sandbox Code Playgroud)

这是我的 pom,用于管理配置文件并更改 gwt.xml。

<profile>
  <id>ci</id>
    <build>
      <plugins>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>gwt-maven-plugin</artifactId>
          <configuration>
                  <module>com.myCompany.myProject</module>
                  <style>OBF</style>
          </configuration>
      </plugin>
    </plugins>
 </build>

</profile>
Run Code Online (Sandbox Code Playgroud)

如果我尝试使用配置文件 ci (mvn package -Pci) 打包项目,则会收到以下错误。

[ERROR] Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.3.0-1:compile (default) on project MyProject: GWT Module com.myCompany.myProject not found in project sources or resources. -> [Help 1]
Run Code Online (Sandbox Code Playgroud)

我该如何解决它?

Ren*_*ato 1

如果您的模块文件位于 src/main/resources/com/myCompany/ ,编译器应该找到您的模块。你能证实吗?

顺便说一句,GWT 模块名称按照惯例以大写字母开头。