I'm trying to lombok for the first time. I tried to follow directions as best as possible, but when I look at my compiled classes (using a decompiler) they do not have any of the generated getters or setters.
My installation steps:
Downloaded lombok 1.14.8 and ran java -jar lombok.jar. It added lombok to eclipse. Restarted Eclipse (-clean the workspace too). If I check my About Eclipse page, I see:
"Lombok v1.14.8 "Branching Cobra" is installed. http://projectlombok.org/"
Added lombok to my pom.xml:
<dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <scope>provided</scope> <version>1.14.8</version> </dependency>
Maven->Update Project. Project->Clean
My Lombok'ed java class:
import lombok.Getter;
import lombok.Setter;
public class User extends BaseCouchDbDocument {
public User() {
// TODO Auto-generated constructor stub
}
@Getter @Setter
private String name;
}
When using the code completion in Eclipse, I see User.getName()
and User.setName()
appear. However, if I try to use the getters or setters, I get a compile time error that no such method exists. When I look at the generated .class file, I only see the following:
public class User extends BaseCouchDbDocument
{
private String name;
}
Similarly, if I run mvn compile
from the command line, I get the same class output.
What I find odd is that the @Getter
and @Setter
annotations are removed, implying that there is some processing occurring on my files. But the getters/setters aren't being generated.
Am I doing something wrong? I'm using Java 7 on a Mac.