Pregunta

I am trying to get files annotated with lombok.jar to compile with maven 3 using one of the Java 8 early access releases. I have maven configured to use the java 8 compiler. The code that I am compiling has a dependency defined for lombok 0.12 in maven central. However when I compile 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 have run maven in debug mode and the classpath entry specified states that the lombok 0.12 jar file is in the classpath of the project. Additionally, I tried setting lombok.jar specifically in my classpath (and I can see in env.CLASSPATH in maven debug mode) which creates the same results.

Everything builds and compiles just fine in eclipse -- what am I doing wrong with the maven configuration/environment such that I can't get compilation to success outside of eclipse?

¿Fue útil?

Solución

To answer my own question -- the issue is with the version of lombok (0.12.0) not working well with java 8. To fix, I used the cutting edge version of lombok , installed it into my local maven repo with the 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.

Once I did that, I was able to compile from command line maven.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top