GWT + Maven - Using gwt-dev package as dependency

1,175 views
Skip to first unread message

Gilberto Torrezan Filho

unread,
Feb 7, 2014, 12:09:23 PM2/7/14
to google-web-tool...@googlegroups.com
Hi,

I'm using GWT 2.6.0 with Maven, using the gwt-maven-plugin, and in my project I have some auto generated classes (using the <generated-with> directive on Module.gwt.xml). The generator is a subclass of com.google.gwt.core.ext.Generator.

The problem is: every time I build my project, Maven emits a warning:

[WARNING] Don't declare gwt-dev as a project dependency. This may introduce complex dependency conflicts

... but I have to declare gwt-dev as dependency, since I need it to compile my code generator.

I never faced any conflict - maybe because I'm declaring gwt-dev with the "provided" scope, avoiding it to be part of the generated war. So, in this scenario, is that warning still accurate? Is there any other way to avoid it (while still having the code generators)?

Thanks.

Colin Alworth

unread,
Feb 7, 2014, 7:50:29 PM2/7/14
to google-web-tool...@googlegroups.com
If you know enough to start writing generators, it almost certainly is not a concern - you are probably also careful with which GWT version you are using as well as which gwt-m-p version. A problem can occur if more than one version of gwt-dev is present on the classpath, such as a mistakenly declared copy in your dependencies and the copy that gwt-m-p automatically pulls in. Provided both versions are the same or care is taken to ensure that gwt-m-p uses the same dependency, there is no issue.

See http://mojo.codehaus.org/gwt-maven-plugin/user-guide/using-different-gwt-sdk-version.html for how to configure your project to allow for different GWT SDK version from the maven plugin. I typically use two different properties, one for gwt.version, and a second for gwt.plugin.version with this strategy to allow them fall out of sync in a safe way.

Thomas Broyer

unread,
Feb 9, 2014, 1:19:20 PM2/9/14
to google-web-tool...@googlegroups.com
AFAICT, the warning originally was added because gwt-dev bundles various dependencies, such as Xalan and Xerces, ECJ, Apache Commons, Jetty, etc. that could conflict with dependencies you use for your server-side code. That said, using the same project for client and server sides is a bad idea, and violates The Maven Way™, so in practice gwt-dev should effectively not be a problem. FWIW, I do believe that warning should be removed.

Also, BTW, you should have rather posted to the gwt-maven-plugin users group, or the GWT users group.

Gilberto Torrezan Filho

unread,
Feb 10, 2014, 8:25:03 AM2/10/14
to google-web-tool...@googlegroups.com
Thank you Thomas and Colin for your replies.

Thomas, sorry for posting in the wrong place. I didn't even know there is a gwt-maven-plugin users group... thanks for pointing that out!

Working with separated projects with GWT, Maven, Eclipse (and his friends - the plugins!) and App Engine is really hard and sometimes frustrating... but when it works is really useful, mainly for environments with continuous integration. All hail to The Maven Way™!
Reply all
Reply to author
Forward
0 new messages