You can create reusable modules (which you mention as samples in the comments) as separate GWT projects without EntryPoint. Put them as jar and add the following as resources :
- client side source code
- other resource elements that will be needed for the final compilation (images, xml files, etc.).
Something like that:
<build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> ... </plugin> </plugins> <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/services/**</include> <include>**/client/**</include> <include>**/public/**</include> <include>**/*.gwt.xml</include> </includes> </resource> </resources> </build>
To do this, you can reuse it in any other GWT project. When you do this, you just need to add the dependency (to the reusable module) in pom.xml and import in *.gwt.xml .
As for Maven's behavior, this seems correct. pom packaging goes through the phases of package , install and deploy and
By default, the compilation target is configured to run during the prepare-package phase to run as late as possible.
You can change the phase in the execution of the plugin, but I think it is dangerous, because you cannot know when exactly at the package stage your code will be compiled.
source share