Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lombok + Java 13 module + NetBeans 11 + Maven

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 
like image 534
pranahata Avatar asked Dec 23 '19 22:12

pranahata


1 Answers

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>
like image 117
Deepak Jain Avatar answered Sep 20 '22 14:09

Deepak Jain