GWT & Maven build best practices

850 views
Skip to first unread message

dhoffer

unread,
Jul 17, 2012, 10:53:12 AM7/17/12
to google-we...@googlegroups.com
I'm assuming that classes in GWT's client folder have no reason to be compiled into classes and go into the war's WEB-INF/classes folder as GWT already converted that to JavaScript but what's the best way to prevent this?  I'm using the gwt-maven-plugin to compile the GWT code in my war maven module.

Thomas Broyer

unread,
Jul 17, 2012, 11:14:19 AM7/17/12
to google-we...@googlegroups.com

On Tuesday, July 17, 2012 4:53:12 PM UTC+2, dhoffer wrote:
I'm assuming that classes in GWT's client folder have no reason to be compiled into classes and go into the war's WEB-INF/classes folder as GWT already converted that to JavaScript but what's the best way to prevent this?  I'm using the gwt-maven-plugin to compile the GWT code in my war maven module.

IMO, the best way is to use separate projects for client and server code (see https://github.com/tbroyer/gwt-maven-archetypes for examples)

Alternately, you can use maven-war-plugin's packagingExclude to exclude WEB-INF/classes/**/client/** classes (and make sure you set all your GWT dependencies –GIN, GXT, whatever– as scope=provided so they don't go in WEB-INF/lib either).
(actually, my archetypes use this in the 'client' module to exclude everything from WEB-INF/ and thus only keep the generated scripts and resources in the client WAR, which is then used as an overlay in the 'server' module that contains the web.xml, index.html, and servlets and other server-side code and dependencies)

David Hoffer

unread,
Jul 17, 2012, 11:37:21 AM7/17/12
to google-we...@googlegroups.com
Thanks, I thought I would look at the module structure you use in your  gwt-maven-archetypes. I downloaded the zip but when I try to run clean install I get this error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2
.2:integration-test (default-integration-test) on project modular-webapp:
[ERROR] Archetype IT 'basic-webapp' failed: Some content are not equals
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
xception
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command

[ERROR]   mvn <goals> -rf :modular-webapp

Any ideas?

-Dave

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/fRPALn54S_EJ.

To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Thomas Broyer

unread,
Jul 17, 2012, 12:09:34 PM7/17/12
to google-we...@googlegroups.com


On Tuesday, July 17, 2012 5:37:21 PM UTC+2, dhoffer wrote:
Thanks, I thought I would look at the module structure you use in your  gwt-maven-archetypes. I downloaded the zip but when I try to run clean install I get this error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2
.2:integration-test (default-integration-test) on project modular-webapp:
[ERROR] Archetype IT 'basic-webapp' failed: Some content are not equals
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
xception
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command

[ERROR]   mvn <goals> -rf :modular-webapp

Any ideas?



David Hoffer

unread,
Jul 17, 2012, 12:22:08 PM7/17/12
to google-we...@googlegroups.com
Yes of course:)  It's our corporate standard.  Deleting the tests solved the problem.

Thanks,
-Dave    

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
Reply all
Reply to author
Forward
0 new messages