I have some Domain classes such as Student, User etc which are used on server and client (gwt) sides.
Can I exclude this domain classes to separate maven-module, so I can add this module as dependency to other maven-modules (i.e. add this module as dependency to maven-module which contains gwt related stuff, so this domain classes will be generated to JavaScript, and add this module as dependency to “normal” (not gwt) Java maven-modules, so this domain classes won’t be generated to JavaScript)?
Yes sure, why not? Consider the following structure:
Have
frontendandbackenddepend oncommonand put your domain objects incommon.You should remember to have
*.gwt.xmlfile exposing your VO’s in thecommonproject and include that in yourfrontend‘sgwt.xmldescriptor, eg.And – as Thomas Broyer points out – remember to make the source code available to
frontend, this does not necessarily have to be in a separate jar, though. You can package the source with the .class files. Thegwt-maven-plugin‘sgwt:resourcesgoal is useful for this purpose:Cheers,