Add a reference to maven: that is, add the jar package of lombok,
- <dependency>
- <groupId>org.projectlombok</groupId>
- <artifactId>lombok</artifactId>
- <version>1.14.4</version>
- </dependency>
Add to the java class that needs to use getters and setters:
@Data
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
, sometimes in order not to let it override the hashCode method, just write:
@Getter
@Setter
@NoArgsConstructor
Install lombok in eclipse,
method:
cmd--" Find the directory where lombok's jar package is located:
E:\working\dataAnalysis\Maven\repository\org\projectlombok\lombok\1.14.4> java -jar lombok-1.14.4.jar
Then select the eclipse software directory, and then install it.
Or you can try adding the following configuration to eclipse.ini in the eclipse directory:
-javaagent:lombok.jar
-Xbootclasspath/a:lombok.jar
And copy the jar package lombok.jar to this directory.