Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: version unspecific release update site

...

Info

The most recent version of the Groovy-Eclipse-Compiler plugin for maven is 2.79.1-01.2.8.0-01-SNAPSHOT is now available from http://nexus.codehaus.org/snapshots/.

The most recent version of the groovy-eclipse-batch artifact is 2is 2.13.37-01. This is

They are both available from maven central.

 

How to use the compiler plugin---Setting up the POM

...

Code Block
languagehtml/xml
<build>
...
<plugins>
  <plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>2.3.2<<!-- 2.8.0-01 and later require maven-compiler-plugin 3.1 or higher -->
    <version>3.1</version>
    <configuration>
      <compilerId>groovy-eclipse-compiler</compilerId>
      <!-- set verbose to be true if you want lots of uninteresting messages -->
      <!-- <verbose>true</verbose> -->
    </configuration>
    <dependencies>
      <dependency>
        <groupId>org.codehaus.groovy</groupId>
        <artifactId>groovy-eclipse-compiler</artifactId>
        <version>2.79.01-01</version>
      </dependency>
    </dependencies>   </plugin>!-- for  2.8..
</plugins>
</build>

By default, this will use Groovy 2.0.4 to compile your code. If you would prefer to use 1.8.6 or 1.7.10, then add another dependency to the maven-compiler-plugin:

Code Block
languagehtml/xml
<dependency>
  0-01 and later you must have an explicit dependency on groovy-eclipse-batch -->
      <dependency>
        <groupId>org.codehaus.groovy</groupId>
        <artifactId>groovy-eclipse-batch</artifactId>
  <version>1.8.6      <version>2.3.7-01</version>
        <!-- <version>1.7.10-06<or choose a different compiler version -->
        <!-- <version>2.1.8-01</version> -->
</dependency>
 </dependencies>
  </plugin>
  ...
</plugins>
</build>

This will allow Groovy files to be compiled. The groovy-eclipse-compiler recognizes all settings supported by the maven-compiler-plugin.

...

Code Block
languagehtml/xml
<dependencies>
  ...
  <dependency>
    <groupId>org.codehaus.groovy</groupId>
    <artifactId>groovy-all</artifactId>
    <version>1<version>2.83.6<7</version>
  </dependency>
  ...
</dependencies>

 

 

Note that the groovy-eclipse-compiler and groovy-eclipse-batch artifacts are available in Maven-central, so there is no need to explicitly declare any extra repositories.

...

Code Block
languagehtml/xml
<build>
  ...
  <plugin>
    <groupId>org.codehaus.groovy</groupId>
    <artifactId>groovy-eclipse-compiler</artifactId>
    <version>2.79.01-01</version>
    <extensions>true</extensions>
  </plugin>
  ...
</build>

...

Code Block
languagebash
mvn archetype:generate \
    -DarchetypeGroupId=org.codehaus.groovy \
    -DarchetypeArtifactId=groovy-eclipse-quickstart \
    -DarchetypeVersion=2.5.2-01 \
    -DgroupId=foo \
    -DartifactId=bar \
    -Dversion=1 \
    -DinteractiveMode=false \
    -DarchetypeRepository=https://nexus.codehaus.org/content/repositories/snapshots/

(This archetype is not actively maintained.)

A sample project using the compiler plugin as well as the source code for the plugin itself are available from the github repository:

...

If you are going to be working with your maven project inside of Eclipse, it is strongly recommended that you use m2eclipse. And to use your Groovy projects with m2eclipse, you will need to install the Groovy-Eclipse configurator for m2eclipse. This feature is available any of the Groovy-Eclipse update sites (e.g., nightly, milestone, or release). Just go to your Eclipse update manager and add the Groovy-Eclipse update sites (if you haven't done so already). Select the Groovy-Eclipse M2E integration.

Release Builds

Development Builds

The Groovy-Eclipse configurator for m2eclipse is not compatible with AspectJ or Scala.  So you cannot use a joint AspectJ/Scala/Groovy project in Eclipse. These languages must be separated into separate sub-projects.

...