Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »




this paragraph is crap.

The Groovy-Eclipse team is proud to announce the first milestone release of the Groovy-Eclipse plugin. In this release of the plugin, we have focused on ensuring that the basic edit-compile-run/debug loop works as smoothly as possible. So, you will see features like support for multiple projects, incremental compilation, and cross-language support. We have also put significant effort into making the plugin compatible with Eclipse's dynamic nature. We have worked hard to make sure that the Groovy model is updated as you type, so that early error detection works as you would expect and content assist will be able to pick up proposals from files that have not yet been saved.

Below is a short list of the new features now available.


Cross language dependencies

Remove? Already available in alpha.

@Grab annotation


Remove? Already available in alpha.

Multi projects dependencies

Remove? Already available in alpha.

Incremental compilation

Remove? Already available in alpha.

AST transforms

Compiler level switching

The Groovy-Eclipse plugin M1 ships with both the 1.7-beta2 and 1.6.5 versions of the groovy compiler. Currently, the only way to switch between the two versions is outside of Eclipse. Here is how:

  1. Shut down Eclipse
  2. Go to eclipse/configuration/org.eclipse.equinox.simpleconfigurator
  3. Make a backup copy of
  4. Open in a text editor
  5. Find the line for org.codehaus.groovy_1.7.0 and delete
  6. Restart eclipse

To re-enable the 1.7 compiler, simply reinstate the backed up copy of

User Interface


The wizards available mimic their Java counterparts.

New Groovy Project Wizard

The new Groovy project wizard allows you to create an Eclipse project pre-configured with Groovy support:

It supports all of the options available for Java projects:

New Groovy Class Wizard

This wizard creates a new Groovy class, with many of the same options available for the Java Class creation wizard:

New Groovy Test Case Wizard

This wizard assists you in creating a new Groovy JUnit 3 or JUnit 4 test case:

Convert Legacy projects

On startup, you are reminded to convert any legacy groovy projects in your workspace:

If you can decide to permanently dismiss this dialog box, you can still do the conversion from the preference pages:

Groovy Editor

As much as possible, we try to provide the same kind of behavior in the Groovy editor as you would expect in the Java editor. By default, the editor uses a different set of colors from the Java editor in order to emphasize the difference between the two languages. However, if you prefer standard Java syntax coloring, you can select it on the following preference page:

Additionally, the Groovy editor provides the following capabilities.

Early error indication

Errors are highlighted as you type. This functionality is provided by hooking into JDT's reconciling capability:


Content assist

Inferencing content assist has been available since earlier versions of the Groovy-Eclipse plugin. We are continuing to improve on this. For M1, we have focused on reliability and availability of content assist. For M2, we will focus on completeness of results. And for the final release, we will work on some performance tuning.

The following code snippet shows an example of the kinds of results that inferencing content assist provides:



Typing F3, or CTRL-click (CMD-click on Macs) will navigate to the definition of a reference. Navigation hooks into the same inferencing engine being used for content assist. So, pressing F3 on the following:


will open an editor on the declaration:


We have introduced type inferencing search in this milestone release. It is still in its basic stages and will be improved upon significantly for the next milestone. For example:


JUnit Monospace font

There is an option in the Groovy Preferences page to show the JUnit results pane in monospace font:


This is helpful for viewing the results of Spock tests:



There are three launch options for your Groovy projects.

h7. Groovy Application

This is similar to launching Java applications. A main method of a Groovy or Java class is launched and you are provided with options similar to launching a standard Java application:


This launch configuration is likely to disappear in future versions because it no longer serves any purpose. All compiled Groovy scripts or Groovy classes with a main method can be run as Java Applications.

h7. Groovy Script

This launch configuration launches a *.groovy file as a script. It is identical to running the groovy command from the command line. This option allows you to use the @Grab annotation.

h7. Groovy Shell

This launch configuration allows you to run a groovy shell in the console view. When run from a particular project, all class files in the classpath of the project are available from the groovy prompt.


Note that there is a bug on windows where the groovy> prompt appears twice on each line. See GRECLIPSE-434.

Breakpoints and debugging

The Groovy-Eclipse plugin allows you to set breakpoints on any statement in a Groovy file, including inside closures:


When launched in debug mode as a Groovy Application or Groovy Script, execution will break when a breakpoint is reached:


Once a breakpoint is reached, (as in Java code) you can evaluate variables:


And evaluate code snippets from the display view (Java syntax required):


The Groovy debugging facility supports conditional breakpoints (Java syntax required):



Indentation & Formatting

The Groovy editor will automatically indent poorly indented code on a paste. So, this:

Becomes this (note that triple quoted strings are not indented):


Quick suffix switching

It is simple to convert from a .java file to a .groovy file and back using the context menu:


Organize imports

The Groovy editor supports automatic organizing of imports (CTRL-Shift-O or CMD-Shift-O). Or you can set your project to automatically organize on save through the project properties page:


Issues addressed for M1

We have fixed over 130 issues for this milestone release:

com.atlassian.confluence.macro.MacroExecutionException: The URL filter is not available to you, perhaps it has been deleted or had its permissions changed
  • No labels