I developed an application in a single Eclipse project using the Eclipse-GWT plugin. Now I would like to move some of my general widgets into a separate Eclipse project. I created a new Java project and wanted to "Add a new GWT module" to it, but the wizard says that "The source folder is not part of a GWT Project." How can I split up my GWT project to avoid building one monolithic thing?
2 Answers
1
votes
Use maven and make sure to turn on resource filtering on the project the other depends on:
<build>
<resources>
<resource>
<directory>src/main/java/</directory>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
...
</build>
For more details have a look at this blog post, and gwt-maven-plugin on multi-module setup.
1
votes
I have successfully divided my GWT project into 2 projects. There are some things you have to watch for:
- You must add the servlet mapping of the first Module into the second Module. This is for the second Module to be able to communicate with the first Servlet.
- In the build path, add a reference to the first module
- In the second Module, call the service of the first module and you can use its declared methods as follows:
Module1ServiceAsync module1Service = GWT.create(Module1Service.class)