GWT compilation error with Maven: No instance of Presenter is defined. Forget to annotate @Presenter or @EventHandler?

381 views Asked by At

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.

0

There are 0 answers