Lombok compilation using maven and java 8

I am trying to get files annotated using lombok.jar to compile with maven 3 using one of the earlier versions of Java 8 access. I configured maven to use the java 8 compiler. The code I compile has a dependency defined for lombok 0.12 at maven central. However, when compiling with maven, I get the following error:

[ERROR] symbol:   variable log
[ERROR] location: class Foo
[ERROR] C:.....\Foo.java:[319,33] error: cannot find symbol

I started maven in debug mode, and the specified classpath entry indicated that the lombok 0.12 jar file is in the classpath of the project. In addition, I tried installing lombok.jar specifically in my class path (and I see enven.CLASSPATH in maven debugging mode), which produces the same results.

Everything builds and compiles just fine in eclipse - what am I doing wrong with the maven configuration / environment so that I cannot get compilation for success outside of eclipse?

+4
source share
1 answer

To answer my own question - the problem is that the version of lombok (0.12.0) does not work well with java 8. To fix, I used the cutting version of the boxes , installed it in my local maven repository with line

mvn install:install-file -Dfile=lombok-edge.jar -DgroupId=org.projectlombok -DartifactId=lombok-edge -Dversion=0.12.1 -Dpackaging=jar 

and then changed the dependencies in my pom accordingly.

As soon as I did this, I was able to compile maven from the command line.

+6
source

All Articles