0

从 Ant Ivy 迁移到 Maven 构建工具。

关于项目的小信息:

  1. 具有很少部署工件的多模块项目。
  2. 在 Ant Ivy 上一切正常,编译和部署正常。

使用 2.7.0 GWT 版本在 Maven 上成功迁移。将版本增加到 2.8.1 后,盯着 gwt 编译错误。

[ERROR]com.example.gwt.client.module.user.GWTEventBus:
Method createInfoPage: No instance of com.example.gwt.client.module.user.presenter.
info.InfoPresenter is defined. Have you forgotten to annotate your event handler 
with @Presenter or @EventHandler?   
[INFO]  at com.mvp4g.util.config.loader.annotation.EventsAnnotationsLoader.
buildPresentersAndEventHandlers (EventsAnnotationsLoader.java:425)   
...long stack trace ...   
at com.google.gwt.dev.Compiler.main(Compiler.java:125)
[INFO][ERROR] Errors in 'com.example.gwt.GWTModule'   
[INFO][ERROR] Line 137: Failed to resolve 'com.mvp4g.client.Mvp4gModule' via deferred binding

第 137 行包含Mvp4gModule module = GWT.create(Mvp4gModule.class);

尝试修复:
1. 比较来自 Ant Ivy 的类路径映射依赖项与 Maven 类路径,一切都相同。所有版本的依赖和插件都很好,没有任何冲突。
2. 尝试使用两个不同的 gwt maven 插件,但使用任何配置都会出现相同的错误:

<plugin>
                <groupId>net.ltgt.gwt.maven</groupId>
                <artifactId>gwt-maven-plugin</artifactId>
                <version>1.0-rc-6</version>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>import-sources</goal>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <moduleName>com.example.gwt.GWTModule</moduleName>
                    <jvmArgs>
                        <jvmArg>-Xmx768M</jvmArg>
                        <jvmArg>-Xss10M</jvmArg>
                    </jvmArgs>
                    <failOnError>false</failOnError>
                    <sourceLevel>1.8</sourceLevel>
                    <compilerArgs>
                        <arg>-compileReport</arg>
                        <arg>-XcompilerMetrics</arg>
                    </compilerArgs>                    
   <warDir>${project.build.directory}/${project.build.finalName}</warDir>
                    <classpathScope>compile+runtime</classpathScope>
                    <startupUrls>
                        <startupUrl>Validation.html</startupUrl>
                    </startupUrls>
                </configuration>
            </plugin>

主要的奇怪是Ant编译成功。Ant 的 compile-gwt 目标与 Maven 的 gwt-plugin 具有相同的配置和参数。

4

0 回答 0