Question

I have a pure-Java project (A) and a GWT project (B) set up as a multi-module GWT project as described here.

When I run mvn install for the first time, A compiles, then B performs a full GWT compile. However if I change anything in A, then B does not compile as I would expect; I get

[INFO] <module> is up to date. GWT compilation skipped.

If I enable <force>true</force then it does compile and I can see my changes.

How can I make my project automatically compile when a dependent module has changed, and skip compilation if nothing has changed?

Was it helpful?

Solution

I wouldn't be surprised if incremental builds are broken in the gwt-maven-plugin, just like in almost every Maven plugin out there: https://cwiki.apache.org/confluence/display/MAVEN/Incremental+Builds

There's a note about it in the sources: https://github.com/gwt-maven-plugin/gwt-maven-plugin/blob/d6464421d9ceb815db2d594ae0bf2d9ca07a1643/src/main/java/org/codehaus/mojo/gwt/shell/CompileMojo.java#L390

I tend to agree that, the maven-compiler-plugin being broken in a similar way, you should do a clean anyway in this situation. Alternatively, if you know the change is compatible with your code and shouldn't change the output of the maven-compiler-plugin, then force the GWT compilation by passing -Dgwt.compiler.force on the command line.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top