apache / netbeans

Apache NetBeans
https://netbeans.apache.org/
Apache License 2.0
2.68k stars 854 forks source link

Enable annotation processing #4496

Open javatlacati opened 2 years ago

javatlacati commented 2 years ago

Apache NetBeans version

Apache NetBeans 14

What happened

In Oracle netbeans there was an option for enabling annotation processing which is missing in apache netbeans.

How to reproduce

on Projects tab select the root of your java project > Properties > Build > Compile

The checkbox "enable annotation processing" is missing.

Did this work correctly in an earlier version?

No / Don't know

Operating System

Windows 10

JDK

Java: 17.0.2; Eclipse OpenJ9 VM openj9-0.30.0 Runtime: IBM Semeru Runtime Open Edition 17.0.2+8

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

A common use case is loading a project with lombok.

Are you willing to submit a pull request?

No

Code of Conduct

Yes

neilcsmith-net commented 2 years ago

That option is still there in the Ant project UI. Which build system are you using? Are you trying to enable to disable? What is actually not working?

javatlacati commented 2 years ago

I'm using maven as build system. It seems that it is enabled by default on Oracle JDK, but when using other one like Semeru it's not.

ebarboni commented 2 years ago

with maven you should edit your pom.xml to have lombok configured

<plugins>
    <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
            <annotationProcessorPaths>
                <path>
                    <groupId>org.projectlombok</groupId>
                    <artifactId>lombok</artifactId>
                    <version>1.18.24</version>
                </path>
            </annotationProcessorPaths>
        </configuration>
    </plugin>
</plugins>

and also append dependencies

<dependencies>
    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>1.18.24</version>          
    </dependency>
</dependencies>

get/set are available in navigator and in code completion. Tutorial is for ant.

javatlacati commented 2 years ago

yes, lombok is configured properly in the pom.xml