Saturday, 31 October 2009

Configuring Maven-based GWT projects for Eclipse

When developing with GWT and maven in Eclipse, you don't get the benefits of the Google Eclipse Plugin by default, as maven and the Maven GWT plugin doesn't configure your Eclipse project settings to work with the GWT plugin. Here's how I changed my POM file to configure the Eclipse project correctly:
          <!-- These are provided by the GWT container -->
If you're using GWT 1.x or earlier snapshots of GWT 2.0 you'll have to replace gwt-dev with gwt-dev-${platform}.

Now, when running mvn eclipse:eclipse, the Eclipse project will use the Google GWT plugin for the core GWT dependencies.

Tuesday, 27 October 2009

Building Maven artifacts for GWT 2.0.0 (trunk) and GWT Incubator

Update: Fixed svn url to GWT incubator.

Here's how I set up Hudson to run daily builds of the upcoming 2.0 version of GWT together with GWT Incubator:

I first set up a job 'GWT-2.0' to check out and build GWT itself. There are two repositories needed:

Hudson then runs the following script to build GWT and deploy the maven artifacts to a local repository:
cd trunk
SVN_REV=`svn info | grep Revision | awk '{print $2}'`
$ANT_HOME/bin/ant clean
$ANT_HOME/bin/ant -Dgwt.version=$GWT_VERSION

for artifact in `ls build/lib`;
$MAVEN_HOME/bin/mvn deploy:deploy-file -DartifactId=$artifact_name -Dversion=$GWT_VERSION -Dpackaging=$artifact_packaging \
-Durl=$LOCAL_REPO -DgeneratePom=true -Dfile=build/lib/$artifact

$MAVEN_HOME/bin/mvn deploy:deploy-file -DartifactId=gwt \
-Dversion=$GWT_VERSION -Dpackaging=zip -Durl=$LOCAL_REPO -DgeneratePom=true -Dfile=build/dist/gwt-$

For GWT Incubator I trigger a build after each successful build of GWT. The Incubator repository is at

After checking out, hudson runs the following script to build and deploy the Maven artifact:

export GWT_TOOLS=/home/hudson/.hudson/jobs/GWT-2.0/workspace/tools
GWT_SVN_REV=`svn info /home/hudson/.hudson/jobs/GWT-2.0/workspace/trunk/| grep \
Revision | awk '{print $2}'`
export GWT_HOME=/home/hudson/.hudson/jobs/GWT-2.0/workspace/trunk/build/staging/gwt-$GWT_VERSION

cd trunk
$MAVEN_HOME/bin/mvn deploy:deploy-file -DartifactId=gwt-incubator \
-Dversion=$GWT_VERSION -Dpackaging=jar -Durl=$LOCAL_REPO -DgeneratePom=true -Dfile=build/dist/gwt-incubator.jar