Building Groovy Eclipse in Eclipse

Below is a step-by-step list of instructions that takes you through the process of setting up an Eclipse environment for building the Groovy-Eclipse plugin. These instructions were written while going through the process on a Mac OS Lion machine.  Except for choosing an Eclipse and installing git, the process is similar no matter which OS and architecture you are using

These instructions are meant for Eclipse 3.7 (Indigo) or Eclipse 4.2 (Juno).

Download and Install Eclipse

Download and unzip Eclipse for RCP/Plug-in Developers from http://eclipse.org/downloads. Choose the appropriate version for your architecture.

Ubuntu note: Don't install Eclipse from the Ubuntu repositories download it manually from eclipse.org instead.

Install git

Groovy-Eclipse is available from github.  To work with github, you need to have git installed on your machine.  Github has some good documentation for a gentle introduction into git and it explains how to install the command line tools.

Install eGit (Optional)

eGit is the Eclipse tool support for working with git source code repositories.  This tooling is helpful for running git operations inside of Eclipse.  Things like viewing history and diffs are much more easily done than with command line tools.  Also, having good integration with Eclipse makes simple operations like committing, pushing and, pulling possible without leaving the IDE.  However, for more complex operations like rebasing and complex merges are typically more easily done on the command line.

To install eGit, use the following update site:

Eclipse 4.3 (Kepler) - http://download.eclipse.org/releases/kepler

Eclipse 4.2 (Juno) - http://download.eclipse.org/releases/juno

Eclipse 3.7 (Indigo) - http://download.eclipse.org/releases/indigo

Choose to install eGit (the visual tooling for git) and jGit (a java-based implementation of git),

No need to restart.

Install Groovy-Eclipse

Some of the projects contain Groovy code, so we need to have Groovy support installed.

Preferably, the latest version of Groovy Eclipse should be installed, which can be obtained from the update site for the latest snapshot.  Now, restart.

See getting a developer build for more information on where to get the development snapshots.

Import Groovy-Eclipse source code into your workspace (the simple way)

The canonical Groovy-Eclipse repository is located at github.  The easiest way to import the source code into your workspace is to use the following Groovy-Eclipse team project set groovy-eclipse-e42-project-set.psf for Eclipse Juno, or groovy-eclipse-e43-project-set.psf for Eclipse Kepler.  To use, go to File -> Import... -> Team project set and paste the URL.  Importing the team project set will take a long time since the entire repository needs to be cloned.

Import Groovy-Eclipse source code into your workspace (the complicated way)

You can ignore this section if you imported the source code the simple way.  This section provides a more detailed description of which projects to import and how to do it if you are not using the psf file above.

If you are running git from the command line, use the following command to clone the repository:

git clone git://github.com/groovy/groovy-eclipse.git

Have a cup of coffee or a beer while the project is cloned.

After cloning is complete, you must import the projects into your Eclipse workspace.  Click on File → Import → Existing projects into workspace.  Choose the top-level git repository folder and search for all projects recursively.  You will see something like this, with many, many projects available for import:

Or, you can clone from inside of eGit.  Use the git repository url above and follow the directions on the eGit documentation.

You do not need to import all projects, and some projects conflict with each other.  Here are some suggestions on what to import:

Run the tests

Optionally, you may want to run the tests.  Do Run As->JUnit plugin test on org.codehause.groovy.alltests.

Note: There are two separate sets of tests in alltests plugin:

At the time when I wrote this, *running both test suites at once resulted in a number of test failures* in the GroovyJDTTests suite. Running both the suites separately I got no such failures.

Note: If you get an Out of Memory Error like this:

java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
...

You can increase the size of PermGen space in "Run As -> Run Configurations"

Add this to VMArguments:

-XX:MaxPermSize=256m

Now, look for some interesting bugs to work on

See the list in jira. All the issues labelled help requested are a good place to start. Also, you can contact the eclipse plugin dev mailing list and we can help you out.