Получение java.яз..ClassNotFoundException: Ломбок.и javac.обработчики.HandleHelper при строительстве maven project


Использование lombok 1.16.6 версии lombok. При сборке (mvn clean install)из командной строки я получаю эту ошибку:

java.lang.ClassNotFoundException: lombok.javac.handlers.HandleHelper
[ERROR] at lombok.core.SpiLoadUtil$1$1.next(SpiLoadUtil.java:114)
[ERROR] at     lombok.javac.HandlerLibrary.loadAnnotationHandlers(HandlerLibrary.java:170)
[ERROR] at lombok.javac.HandlerLibrary.load(HandlerLibrary.java:155)
[ERROR] at lombok.javac.JavacTransformer.<init>(JavacTransformer.java:43)
[ERROR] at lombok.javac.apt.Processor.init(Processor.java:86)
[ERROR] at lombok.core.AnnotationProcessor$JavacDescriptor.want(AnnotationProcessor.java:87)
[ERROR] at lombok.core.AnnotationProcessor.init(AnnotationProcessor.java:141)
[ERROR] at lombok.launch.AnnotationProcessorHider$AnnotationProcessor.init(AnnotationProcessor.java:53)
[ERROR] at com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.<init>(JavacProcessingEnvironment.java:500)
[ERROR] at com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next(JavacProcessingEnvironment.java:597)
[ERROR] at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:690)
[ERROR] at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)
[ERROR] at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035)
[ERROR] at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176)
[ERROR] at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
[ERROR] at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856)
[ERROR] at com.sun.tools.javac.main.Main.compile(Main.java:523)
[ERROR] at com.sun.tools.javac.main.Main.compile(Main.java:381)
[ERROR] at com.sun.tools.javac.main.Main.compile(Main.java:370)
[ERROR] at com.sun.tools.javac.main.Main.compile(Main.java:361)
[ERROR] at com.sun.tools.javac.Main.compile(Main.java:56)
[ERROR] at com.sun.tools.javac.Main.main(Main.java:42)
[ERROR] Caused by: java.lang.ClassNotFoundException: lombok.javac.handlers.HandleHelper
[ERROR] at java.lang.ClassLoader.findClass(ClassLoader.java:530)
[ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[ERROR] at lombok.launch.ShadowClassLoader.loadClass(ShadowClassLoader.java:366)
[ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[ERROR] at java.lang.Class.forName0(Native Method)
[ERROR] at java.lang.Class.forName(Class.java:348)
[ERROR] at lombok.core.SpiLoadUtil$1$1.next(SpiLoadUtil.java:111)


$ mvn -v
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T17:27:37+05:30)
Maven home: /usr/share/maven
Java version: 1.8.0_60, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_IN, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-66-generic", arch: "amd64", family: "unix"

Это не дает никакой ошибки от идеи Intellij.

1 2

1 ответ:

Как упоминалось в https://projectlombok.org/mavenrepo/, Вы должны определить зависимость для области lombok с provided. как показано в следующем примере

<dependencies> 
    <dependency> 
        <groupId>org.projectlombok</groupId> 
        <artifactId>lombok</artifactId> 
        <version>1.16.6</version> 
        <scope>provided</scope> 
    </dependency> 
</dependencies>