0

I'm trying to use Lombok in a Maven project with Java 8, but Lombok doesn't generate any Getters and Setters when I apply the @Data Annotation. I tried to use Maven Compiler Plugin Version 3.5 as mentioned here, but it didn't help. Does anybody have I clue, which versions I need to use?

pom.xml

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

...

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.5</version>
    <configuration>
        <source>1.8</source>
        <target>1.8</target>
    </configuration>
</plugin>
  • Have you checked to use most recent version 3.6.1 of [maven-compiler-plugin](http://maven.apache.org/plugins/maven-compiler-plugin/) ? – khmarbaise Feb 25 '17 at 13:43
  • It seems that methods are created, but not recognised by Eclipse IDE. I created a Unit Test, which runs just fine. The test uses getter and setter, created by Lombok. Is there a way, that Eclipse is aware of the generated methods? –  Feb 25 '17 at 15:16

1 Answers1

1

The answer is described in this thread.

  1. Download Lombok JAR from here.
  2. Doubleclick the JAR and install it in your Eclipse installation directory
  3. Restart Eclipse and check whether you can find this text: Help > About Eclipse > "Lombok vX.XX.XX is installed. https://projectlombok.org/". It should be found somewhere in the about text.
  4. Open eclipse.ini in your Eclipse installation directory and add following lines at the end. (if they do not already exist)

    -javaagent:lombok.jar
    -Xbootclasspath/a:lombok.jar