13
<dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>0.12.0</version>
        <scope>compile</scope>
    </dependency>

Not generating the getter or setter when using maven and can not find the option to turn it on when I use netbeans maven project.

In maven projects that are not only active when this happens the option that lombok recommended (http://projectlombok.org/setup/netbeans.html) maven project but can not find it and neither generates.

Thanks for your time.

josemm1790
  • 831
  • 2
  • 11
  • 19
  • Are you still experience this issue? What errors Maven shows? – Boj Nov 10 '13 at 06:26
  • Maven does not fail, the problem is that netbeans does not see me nor the get set and then when I try to use one of those methods I get an error that the method does not exist. – josemm1790 Nov 18 '13 at 18:53
  • 1
    not, in the end we decided not to use maven. – josemm1790 Apr 10 '14 at 13:29
  • Please note, that Lombok can fail to generate bytecode for other reasons, not necessarily because of NetBeans. For example, [it does not work with AspectJ](http://stackoverflow.com/questions/25903686/lombok-does-not-work-with-aspectj). – naXa stands with Ukraine May 09 '15 at 15:13

2 Answers2

6

This worked for me with Netbeans 8

https://blogs.oracle.com/geertjan/entry/lombok_maven_and_netbeans

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

Then you should also make a mvn clean package in the CLI, before it actually works.

juanmf
  • 2,002
  • 2
  • 26
  • 28
  • 1
    I had a similar issue using Lombok 1.16.6 being built within Netbeans 8.1RC. It appeared Lombok was not generating a constructor within a class with two final String variables (with both variables as parameters to the constructor). Simply downgrading to 1.14.4 fixed it. Just to be sure, I switched back to 1.16.6 and it broke again. – Brooks Jan 29 '16 at 21:40
0

Source :

Dzone

Solution :

As per the Lombok documentation, usually you only need to put this in your pom:

<repositories>
    ...
    <repository>
        <id>projectlombok.org</id>
        <name>Lombok Repository</name>
        <url>http://projectlombok.org/mavenrepo</url>
    </repository>
</repositories>

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

It works, but the Maven NBM plugin will embed the lombok jar into the generated .nbm. To avoid that, you just need to add the scope element as below:

<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
    <scope>provided</scope>
</dependency>
chillworld
  • 4,207
  • 3
  • 23
  • 50
  • Nope, this doesn't fix it. This solution on DZone regards the *packaging* into a NB module, rather than internal NB annotation processors. – nevvermind Aug 02 '14 at 15:10
  • @nevvermind I use also lombok with maven 3 and netbeans 7.3 => no problem here. – chillworld Aug 03 '14 at 19:09