Development on GWT with Eclipse in teamPosted by Andrij Skaljuk - 20.10.2007, 15:38
Tags: Eclipse GWT team
When a developers team is starting a project, they are choosing tools, IDE, source control system and the way they are going to stay in touch. We chose Eclipse IDE for development and Subversion (SVN) for code sharing. This is popular combination because it is useful for Java development and specially for GWT.
Successful project code compilation requests correct build path for GWT libraries, but different developers' project sources and GWT libraries are located in different places on file system. We suggest solution for common project workspace for all developers based on Eclipse environment variables. Testing was done on Eclipse 3.2 and 3.3.
The idea is to create Eclipse environment variable GWT_HOME, which is referenced on GWT library placement locally on each developer's system. In this case each team member will have working project environment. Settings example for project in Windows and remark for Linux is described below.
Setting GWT_HOME variable
Next steps are done for each developer once:
- Go to Classpath Variables menu in Eclipse: Menu - Window - Preferences - Java - Build Path - Classpath Variables;
- Create GWT_HOME variable. Press New button:
- specify name. Name: GWT_HOME;
- specify path to GWT library root e.g. "c:\gwt".
Creating new GWT project, initial commit:
- Use GWT utilities to create project:
- projectCreator -eclipse NewApplication -out d:\test\
- applicationCreator -eclipse NewApplication -out d:\test\ net.pleso.client.NewApplication
- Import created project into Eclipse workspace. Menu - File - Import - Existing Projects into Workspace. Specify project placement e.g. "d:\test\"
- Configure gwt-user library using GWT_HOME:
- right click on project root - Properties - Java Build Path - Libraries
- delete gwt-user.jar
- Add Variable - GWT_HOME - Extend - gwt_user.jar - Ok
- Configure gwt-dev-windows.jar library using GWT_HOME:
- Run - Java Application - NewApplication (your name) - Classpath
- gwt-dev-windows.jar - Remove
- Advanced - Add Classpath Variables - GWT_HOME - Extend - gwt-dev-windows.jar - Ok
- Commit project to SVN repository.
- Not necessary but you can add to svn:ignore:
How to checkout project from SVN
- checkout project. Menu - File - Import - Checkout from SVN - trunk;
- project name must be the same as created. Eclipse automatically fills name in Project Name field. In this example it will be: NewApplication;
- after project checkout from SVN: Run - java application - NewApplication - Run - Host-mode window GWT launching;
- debug executes in the same way.
Remark for Linux users
- replace library files (such as gwt-dev-windows.jar) on Linux versions;
- create customized Run/Debug Config for Linux. Go to: Run - java application - select NewApplication - right click Dublicate - name NewApplicatiion-Linux;
- make the same changes as described in "Creating new GWT project";
- you should get two Run/Debug configurations;
- commit project to SVN. As result you have different configurations for Windows and Linux.
We know following alternative solution for team development which requires additional Eclipse plugin installation: Googlipse - An Eclipse plugin for Google Web Toolkit (GWT).Click here to add a new comment »