Monday, February 28, 2011

Re: what gwt libraries should be included in production build

On Sunday, February 27, 2011 7:54:13 PM UTC+1, zixzigma wrote:
do I need gwt-servlet and gwt-user library, in my pom.xml ?

It depends what you do with your pom.xml, i.e. how you use the dependencies.
I was uploading my gwt app on app engine, I got the error
saying gwt-user jar is too big, and I need to split it.
I decided to comment out gwt-user, and I didn't get any error or warning,
which made me wonder what dependencies I need to include in my build ?

and is there a library that need to be present in development mode, that should be excluded in final build ?

DevMode and Compiler classes are in gwt-dev.jar, and all the code you use to build your app is in gwt-user.jar. Almost everything in gwt-user.jar is aimed at being compiled to JavaScript, the rest is present in gwt-servlet (making gwt-servlet a subset of gwt-user; well, there might be a few classes from gwt-dev too that are also copied to gwt-servlet, but that's an implementation detail).
In brief, you need gwt-dev and gwt-user to build your client-side code, and you need gwt-servlet (and only gwt-servlet) on the server-side (and only if you use GWT-RPC and/or RequestFactory).

This means that if your mix client-side and server-side code in your Maven module, you need to have gwt-user as <scope>provided</scope> (it's indeed provided by the gwt-maven-plugin) and gwt-servlet as <scope>runtime</scope> (gwt-dev is provided by the gwt-maven-plugin, so you don't need an explicit dependency, unless you have to write a generator or linker, but then beware of conflicts with some libraries; you'd better split your app into a client-side only and server-side modules)

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment