GWT SDK 2.4 jars

79 views
Skip to first unread message

James Horsley

unread,
Sep 12, 2011, 7:24:08 AM9/12/11
to google-we...@googlegroups.com
Is there a good breakdown of what each of the jars are for and at what point in the dev lifecycle they're intended to be used? There seems to be a large set of overlap between the various jars content wise. While I can make educated guesses it'd be great to have an official statement of their intents.

Cheers,
James

Thomas Broyer

unread,
Sep 12, 2011, 8:38:23 AM9/12/11
to google-we...@googlegroups.com
I unfortunately don't think you'll find any "official statement" (or maybe in documentation for older versions, but I cannot find any in the current documentation).

  • gwt-dev contains the compiler and the DevMode; i.e. the dev tools.
    It's only needed at compile-time, and shouldn't be needed by your code, unless you're coding generators or linkers (that somehow "plug" into the compiler and devmode, so their APIs are defined in gwt-dev)
  • gwt-user contains the "user library", i.e. what you'll use in your code that will either be compiled to JS or run on the server. gwt-user has an implicit dependency on gwt-dev, as it contains generators and linkers.
    It also contains a few tools (webAppCreator, i18nCreator, etc.), most of which a deprecated (webAppCreator, i18nCreator, etc.), and the JUnit support (GWTTestCase et al.)
    This is what you'll add as to your project as a dependency (compile-time only though). gwt-user bundles a few dependencies (javax.servlet, “Flute” the CSS parser from the W3C) so it's not to be deployed.
  • gwt-servlet is a subset of gwt-user (well, there are also a few classes from gwt-dev) containing code to be run on the server (RemoteServiceServlet, etc.)
The line between gwt-dev and gwt-user is a bit blurry though, and a few utility classes from gwt-dev are used in gwt-servlet too. This is all historical. If GWT were to be repackaged today, classes would probably be split differently among JARs.

Finally, unless you intend to contribute to GWT (or go into deep debug sessions of GWT itself), all you have to know is that your project should have gwt-user.jar as a dependency; possibly gwt-dev.jar too; and you'll only ever deploy gwt-servlet.jar. gwt-dev is used for the devmode or to compile your code (or as a dependency if you have a generator or linker in your code).

Now, in GWT 2.4, there are a few new JARs:
  • requestfactory-client: client-side code for RequestFactory (includes RequestFactorySource), to be used in a VM (unit tests, stress-tests, or an Android or desktop app)
  • requestfactory-server: server-side code for RequestFactory (includes RequestFactoryServlet). If you only use RF on the server (no GWT-RPC, no SafeHtml, etc.) then you can deploy this JAR instead of gwt-servlet.jar.
  • requestfactory-apt: annotation processor, used at compile-time only. See http://code.google.com/p/google-web-toolkit/wiki/RequestFactoryInterfaceValidation
There's a large overlap between client and server, as "shared" code is in both JARs.

Additionally, all three (client, server and apt) are bundled within gwt-user.

James Horsley

unread,
Sep 12, 2011, 9:25:22 AM9/12/11
to google-we...@googlegroups.com
Thomas, you've cleared up all the questions I had so many thanks for your super informative answer! Seems like this should be in a wiki somewhere on the main GWT site or perhaps worth a posterous entry from yourself?

Cheers,
James

--
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/-/frzl_Ljvo6wJ.
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.

Ido

unread,
Sep 12, 2011, 3:02:00 PM9/12/11
to google-we...@googlegroups.com
Thanks a lot for the information!
Reply all
Reply to author
Forward
0 new messages