Annotation processor generated code not available to GWT compiler.

58 views
Skip to first unread message

Tercio Gaudencio Filho

unread,
Jan 2, 2015, 5:22:10 PM1/2/15
to codehaus-mojo-gwt-...@googlegroups.com
Hi!

In my project I have an annotation processor that generates some classes to be used in the client code(To be compiled by GWT compiler). I also use Gin.

But when I try to run mvn gwt:run-codeserver, it complies about my newly generated class not been available.

My classes are generated on "target/generated-sources/annotations" folder. Eclipse sees it normally.

[INFO]    Tracing compile failure path for type 'my.package.client.ui.login.impl.LoginPresenterImpl'
[INFO]       Errors in 'file:/Users/terciofilho/gwt/myproject/src/main/java/my/package/client/ui/login/impl/LoginPresenterImpl.java'
[INFO]          Line 41: No source code is available for type my.package.client.ui.login.event.OnUserLoggedEvent; did you forget to inherit a required module?

Looks like these files are not available to the GWT compiler.

Thanks.

Thomas Broyer

unread,
Jan 3, 2015, 6:19:35 PM1/3/15
to codehaus-mojo-gwt-...@googlegroups.com
Which version are you using? Does "mvn package" (assuming gwt:compile bound to prepare-package phase) works? Does "mvn process-classes gwt:run-codeserver" changes anything?

Tercio Gaudencio Filho

unread,
Jan 5, 2015, 9:57:46 AM1/5/15
to codehaus-mojo-gwt-...@googlegroups.com
Hi!

No, mvn package and mvn process-classes gwt:run-codeserver doesn't work either

To continue developing I'm copying the generated classes to my project and building.

I'm using GWT 2.7.0, gwt-maven-plugin 2.7.0.

The folder that the classes are generated are no included in the classpath. I read about other bugs about adding some folders to classpath but the commit that added this functionality has been reverted.

Thanks!

Thomas Broyer

unread,
Jan 5, 2015, 12:21:45 PM1/5/15
to codehaus-mojo-gwt-...@googlegroups.com
This is a maven-compiler-plugin issue that has been solved in 3.2: http://jira.codehaus.org/browse/MCOMPILER-157
(note that it introduces side-effects though, failing the build in some cases; you might want to set <proc>none</proc> and use the maven-processor-plugin or apt-maven-plugin to process annotations during the generate-sources phase; or use the build-helper-maven-plugin as a workaround to add target/generated-sources/annotations as a source root before gwt:compile)
Reply all
Reply to author
Forward
0 new messages