How to keep client classes out of WEB-INF/classes?

40 views
Skip to first unread message

phine...@gmail.com

unread,
Feb 26, 2015, 11:02:05 AM2/26/15
to codehaus-mojo-gwt-...@googlegroups.com
My GWT client classes are all ending up in WEB-INF/classes and being published to the server. That doesn't seem particularly clean, and doesn't allow me to catch unwanted dependencies from server or shared to client code. To build, I use Maven 3.2.5, GWT 2.7 (w/ SuperDevMode) and gwt-maven-plugin 2.7.0.

Do client classes still even need to be in WEB-INF/classes during development when using SuperDevMode?

I also found this old thread about how people dealt with this back in 2011:

https://groups.google.com/forum/#!searchin/codehaus-mojo-gwt-maven-plugin-users/WEB-INF$2Fclasses/codehaus-mojo-gwt-maven-plugin-users/hfwTHFPrJy0/ZqmlyA2SU9oJ

Is this still the state of things?

Thomas Broyer

unread,
Feb 27, 2015, 6:11:58 AM2/27/15
to codehaus-mojo-gwt-...@googlegroups.com
You could use maven-war-plugin's packagingExcludes: https://maven.apache.org/plugins/maven-war-plugin/war-mojo.html#packagingExcludes
But the real solution, following The Maven Way™, is to split your project in separate modules.
See http://blog.ltgt.net/announcing-gwt-maven-archetypes-project/ for the rationale (and note that my archetypes have recently moved to a new gwt-maven-plugin!)

phine...@gmail.com

unread,
Feb 27, 2015, 12:36:50 PM2/27/15
to codehaus-mojo-gwt-...@googlegroups.com
Ok, that helps a lot, I've done it with maven-war-plugin's packagingExcludes for now:

<configuration>
   
<packagingExcludes>WEB-INF/classes/mypackage/**/client/**</packagingExcludes>
</configuration>


with a comment for later in case I come across some more benefits to modularization. For now, this was a lot easier than modularizing everything. :)
Reply all
Reply to author
Forward
0 new messages