Archive for June, 2010

h1

Maven and GWT can live together

June 18, 2010

I recently started working on a requirement where the UI was to be developed using GWT. Being a maven fan for quite sometime now, I started using gwt-maven-plugin to create a GWT maven plugin. And ofcourse everything was fine till the point I started adding external maven dependencies. GWT compile started complaining about the source not found for tons of classes. I googled around and find out the only way to get around the issue was to use GWT modules for external dependencies and inherit them in main GWT UI application. This approach works flawlessly if you are working with project created in Eclipse using the GWT web project wizard and other dependent projects are standard Eclipse Java project. This approach wasn’t supposed to work, as most of our applications or artifacts are maven based project. On further googling and downloading the source code of gwt-maven-plugin it turns out there is another version of gwt-maven-plugin available on svn repository of GWT project itself. It’s version is 1.3.1.google. Also there is another configuration that needs to be added in gwt-maven-plugin configuration namely “configureSourcesArtifacts” for all the dependencies you have source or is downloadable from the maven repository. You can find more detailed explanation of this configuration on the gwt-maven-plugin site under gwt:compile goal. Once you setup this configuration running mvn compile gwt:compile will be able to compile the GWT project for all permutations with ease.

Please contact me in case you need a sample pom file which I am using for my project.

Happy mavenizing GWT 🙂