Do it the way you would any module. This should not be a web application, no additional configuration files are required. Just the sources are packaged in a jar file. Real requirements:
- Follow the instructions to create the module:
- Prepare the descriptor file
*.gwt.xml in the root directory of your module. - You have a
client package for classes that are meant to be compiled into js and server for the rest.
- Be sure to include sources in the jar file.
Interestingly, if your module does not depend on any GWT classes or uses jsni, you can use it also with "normal" Java applications.
The answer to the second question (how to reuse it) is simple: add the newly created jar to your classpath and inherit this module in the module descriptor of your web application.
And yes, if you have it in the bank, you can let it go, -)
A great example of this approach is Ext GWT (aka GXT): http://www.sencha.com/products/extgwt/ just download this library, unzip and see setup.txt for installation instructions and how to execute gxt.jar (reused module).
genobis
source share