GWT 2.4 introduced changes to both Maven and RequestFactory, and we’ve recently updated the GWT wiki and sample apps with the latest and greatest:
RequestFactory now does compile-time validation to ensure that your service implementations match your client-side interfaces. This feature is implemented using an annotation processor which must be configured in Eclipse or in your Maven POM. When configured in Eclipse, you will now see warnings and errors in the IDE anywhere your client- and server-side RF code don’t match.
In addition, the RequestFactory jars are now in Maven Central. Note that the Maven groupId for RF artifacts differs from the rest of the GWT artifacts since RF can be used in Android clients as well as GWT. If you’re using RequestFactory instead of GWT-RPC, you no longer need gwt-servlet. Instead, you can use the much smaller requestfactory-server jar and requestfactory-apt (which contains the RF interface validation tool). You do not need requestfactory-client for GWT projects as the required classes are already included in gwt-user. The requestfactory-client jar is intended for non-GWT (Android) clients using RequestFactory.
<dependency> <groupId>com.google.web.bindery</groupId> <artifactId>requestfactory-server</artifactId> <version>2.4.0</version> </dependency> <!-- see sample projects for correct placement --> <dependency> <groupId>com.google.web.bindery</groupId> <artifactId>requestfactory-apt</artifactId> <version>2.4.0</version> </dependency>
If you also have the Eclipse Subversive plugin installed (see http://www.shareyourwork.org/roller/ralphsjavablog/entry/eclipse_indigo_maven_and_svn), you should be able to try the mobilewebapp sample as easily as
- File > Import > Checkout Maven projects from SCM, point to https://google-web-toolkit.googlecode.com/svn/trunk/samples/mobilewebapp
- Run as > Web application
Special thanks to Jeff Larsen for the RequestFactory POM sauce that works in Eclipse Indigo!