All right,
I am trying to get lombok to work on a maven project with NetBeans 11 + JdK 13. The IDE seems to see the lombok and it autocompletes on @Getter annotated methods but at compile time lombok looks like it is not there
on my pom:
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.10</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.0-alpha1</version>
</dependency>
module-info
module uno.anahata.rpc {
requires static org.slf4j;
requires static lombok;
requires org.apache.commons.lang3;
}
compiler output
-d C:\Users\Pablo\Documents\NetBeansProjects\anahata-rpc\target\classes -classpath C:\Users\Pablo\Documents\NetBeansProjects\anahata-rpc\target\classes; --module-path C:\Users\Pablo\.m2\repository\org\projectlombok\lombok\1.18.10\lombok-1.18.10.jar;C:\Users\Pablo\.m2\repository\org\slf4j\slf4j-api\2.0.0-alpha1\slf4j-api-2.0.0-alpha1.jar;C:\Users\Pablo\.m2\repository\org\apache\commons\commons-lang3\3.9\commons-lang3-3.9.jar; -sourcepath C:\Users\Pablo\Documents\NetBeansProjects\anahata-rpc\src\main\java;C:\Users\Pablo\Documents\NetBeansProjects\anahata-rpc\target\generated-sources\annotations; -s C:\Users\Pablo\Documents\NetBeansProjects\anahata-rpc\target\generated-sources\annotations -g -deprecation -target 13 -source 13 --module-version 13.0.0-SNAPSHOT
File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
incrementalBuildHelper#beforeRebuildExecution
Compiling 7 source files to C:\Users\Pablo\Documents\NetBeansProjects\anahata-rpc\target\classes
incrementalBuildHelper#afterRebuildExecution
-------------------------------------------------------------
COMPILATION ERROR :
-------------------------------------------------------------
uno/anahata/rpc/client/RpcInvocationHandler.java:[54,9] cannot find symbol
symbol: variable log
location: class uno.anahata.rpc.client.RpcInvocationHandler
uno/anahata/rpc/client/RpcInvocationHandler.java:[68,9] cannot find symbol
symbol: variable log
location: class uno.anahata.rpc.client.RpcInvocationHandler
2 errors
Can you try moving the lombok dependy inside annotationProcessorPaths and do clean build
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.10</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With