I am trying to add groovy to an existing Java Maven project that leverages Lombok. Unfortunately when I enable the groovy-maven-eclipse compiler with the pom fragment below, my lombok annotated java files fail to compile. As far as I can tell, Lombok is not participating in the compilation of java files at all.
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<compilerId>groovy-eclipse-compiler</compilerId>
<verbose>true</verbose>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>2.6.0-01-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin>
I should also point out that while in eclipse (with m2e) everything works fine. My problem arises when I try to do a mvn package.
@Todd: The groovy-eclipse-compiler is the best choice if you don’t need to developp maven plugin with some groovy tooling (see http://groovy.codehaus.org/Groovy-Eclipse+compiler+plugin+for+Maven).
@Ambience: you reached the issue related at http://jira.codehaus.org/browse/GRECLIPSE-1293.
This bug is now fixed with latest groovy-eclipse-compiler 2.6.1-01-SNAPSHOT.
Note: The latest version available is now 2.9.1-01, see http://docs.groovy-lang.org/latest/html/documentation/tools-groovyeclipse.html
You have to modify your pom like this:
The mandatory parts:
The added dependency on lombok inside the maven-compiler-plugin
Edit: update versions