Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


Why another Groovy compiler for Maven? What about GMaven?

There are several benefits that the compiler plugin provides over GMaven, but at the same time it has a few limitations. First, the benefitsGMaven 2.0 and later no longer supports compilation.  You can read more about this on the GMaven 2 project page. GMaven 1.x is now deprecated.

GMaven 1.x had limitations over the groovy-eclipse-compiler and for the following reasons GMaven 2.0 compilation is no longer supported:

  1. The compiler plugin does not require the creation of Java stubs so that your Groovy files can compile against Java files. This will prevent some arcane compile errors from appearing.
  2. The Groovy-Eclipse compiler is the same inside Eclipse and inside Maven, and so configuration across the two platforms can be simplified.
  3. The compiler plugin is a standard compiler plugin for Maven. It therefore follows all allows all the same standard configuration that the Javac compiler plugin uses. This makes it simpler to introduce Groovy into an existing Maven project. All you need to do is change the compiler plugin that the pom references.

There are still some limitationsreasons to use GMaven:

  1. GroovyDoc tool is not supported because the compiler plugin does not produce stubs.
  2. Groovy Mojos are not supported.
  3. Groovy scripts cannot be executed in your poms.
  4. Groovy compiler options are not passed through to the compiler.
  5. The defaultScriptExtension compiler option is not supported.

Whether or not the Groovy-Eclipse compiler plugin for Maven is appropriate for your project will depend on your requirements.