0

Migrate from Ant Ivy to Maven build tool.

Little info about project:

  1. Multi-module project with few deploying artifacts.
  2. On Ant Ivy everything fine, compilation and deploy passes normal.

Migrate on Maven pass successfully with 2.7.0 GWT version. After increasing version to 2.8.1, stared to get gwt compilation error.

[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

Line 137 contain Mvp4gModule module = GWT.create(Mvp4gModule.class);

Attempts to fix:
1. Compared classpath mapped dependencies from Ant Ivy with Maven classpath, everything the same. All versions of dependencies and plugins are fine, without any conflicts.
2. Tried with two different gwt maven plugins, but get the same error with any configurations:

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

Main strangeness is that Ant compile successfully. Ant's compile-gwt target has the same configuration and arguments as Maven's gwt-plugin.

El Hoss
  • 3,767
  • 2
  • 18
  • 24
  • One of your presenters or eventhandlers will have a compile error so that mvp4g cannot generate the necessary sources. Set the logLevel to TRACE and search for "ERROR"-strings inside the log. – El Hoss Jun 30 '17 at 08:55
  • @ElHoss TRACE log got quite the same error information. I'm sure that Presenter's and EventHandler's code right, because I can build the same project from same directory by Ant and get successful result. – IlyaBondarenko Jun 30 '17 at 09:08
  • Are you using Eclipse? If yes, make sure, that you see all log entries! – El Hoss Jun 30 '17 at 09:12
  • @ElHoss I make everything from command line. Thank you – IlyaBondarenko Jun 30 '17 at 09:27
  • You will have a compile issue. Otherwise mvp4g won't throw an exception. I assume, that something is missing in your classpath. To know what, the error messages will be a good point to start. – El Hoss Jun 30 '17 at 09:30

0 Answers0