Welcome to Framework Limbo! Using Eclipse, Maven, GWT and Lombok

One of the main advantages of service engineering in Java is that there are quite a lot of environments, libraries, frameworks, IDEs and plugins to choose from. That’s also a major drawback. We ran into this while doing a recent prototyping project, and once again discovered the hard way that there is a certain threshold before you run into framework limbo, dependency hell and assorted related afflictions.

There is a saying in Dutch about donkeys and bumping into the same stone twice. Our new general rule of thumb is that you should use never use more than about two (plus or minus one) environments, libraries, frameworks, IDEs and / or plugins at once. Ever. You’ll save yourself from being a donkey by using only the stuff you really need. So read on if you want to risk countless hours of frustration with Eclipse, Maven Google Web Toolkit and Lombok.

Disclaimer: we have switched to using another GUI framework which is more suited to our needs.

Prerequisites: Environment, Reading and Configuration

Overview of environments, libraries, frameworks, IDEs and plugins used in this article:

First of all, credit where credit is due, so do some light reading to get you started:

  • Lars Vogel’s excellent guide for including other project in an Eclipse GWT project.
  • The main GPE issue that we kept running into and kept us from using Lombok in the end.
  • GWT’s Serializable Type Guide. Read this to learn about what you can and can’t send over the line using GWT’s RPC mechanism.
  • The GWT Wiki’s Working With Maven entry. Describes the steps of getting m2eclipse to play nice with GWT and Eclipse 3.7. When starting a new project based on the gwt-maven-plugin archetype, be sure to quick fix the lifecycle management errors and correct your POM to “execute” instead of “ignore” the execution steps, as listed in the comments below the entry.

Also, be sure to configure Eclipse to run in the 1.6 JDK (configure -VM in eclipse.ini to point to your javaw.exe in the JDK). We’ve had too many issues from using anything higher than a 1.6 JDK. Also make sure that you’ve set your JAVA_HOME environment variable to the correct path.

Eclipse Project Structure: Simple vs. GWT Projects

Let’s start off with the project structure. I’m not going to go in-depth on how to set this up, but you’d typically want to split your code into two or more Eclipse projects. One or more are fairly simple Maven-enabled projects which contain code you’d like to share with other projects, such as the project data model. The simple projects contain code annotated with Lombok annotations. The other is a Maven project based on the gwt-maven-plugin archetype. This project contains the GWT stuff and the web GUI.

Main Points of Attention: No Lombok, Source Available via Maven

Now that you have the project structure set up, there are two main points of attention.

Don’t use Lombok in the classes that GWT has to use. GWT will not be able to interpret Lombok-ed source code due to the bug outlined in the light reading section. This is a shame: Lombok saves you heaps of time coding getters, setters, delegates and other stuff you typically spend too much time on. So, for the non-GWT Eclipse projects, de-Lombok the classes that you want to serialize using GWT’s RPC mechanism. We did our de-Lombok manually after our data model was done, but we’ve also experimented with the Maven Lombok plugin to de-Lombok automatically. Go here if you’re interested.

Make the source code of the simple projects available in GWT via Maven. This is necessary for GWT hosted mode, since it uses source code to compile client-side JavaScript.

For non-Eclipse projects:

  • Include a module .gwt.xml in your simple projects for the classes that you’ll be using in GWT as outlined by the article in the light reading section
  • Configure the POM to include source generation. This means configuring maven-source-pluginin the POM:

For the GWT Eclipse project, include the correct Maven dependency on the simple projects. This means using the source classifier in the POM dependency description:



It looks simple, but you will run into trouble. When you do:

  • Delete your run configurations for GWT
  • Clean your projects in Eclipse and do Maven->Updates
  • Run mvn:clean and mvn:install for your simple project
  • Be sure to set the debug level to “ALL” in your Eclipse run configuration to make sense of which classes don’t work in GWT.
This entry was posted in programming and tagged , , , , , . Bookmark the permalink.

1 Response to Welcome to Framework Limbo! Using Eclipse, Maven, GWT and Lombok

  1. Jon says:

    You said you experimented with the Maven Lombok plugin. Did you have any success? If so, could you share a simple example? The example test-maven-lombok rpoject that you liked to has an example pom but I’m new to all these technologies. I don’t understand how to merge what I see there into a gwt-maven based project pom.

    Also, what was the GUI framework that you switched to?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s