Lombok not generating Getters and setters in Gradle Project

42 Views Asked by At

I am using lombok + Gradle in my Spring boot application. I have installed Lombok plugin from marketplace and the same version I have mentioned in my build.gradle but still in my model class I am getting a warning that generate getters and setters and also other classes not able to access the getters and setters. I have also added lombok.config in my root folder with lombok.addLombokGeneratedAnnotation = true. I am not sure which config I am missing?

build.gradle

plugins {
id 'org.springframework.boot' version '2.5.0'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
}


version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'

repositories {
mavenCentral()
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.projectlombok:lombok:1.18.30'
runtimeOnly 'com.h2database:h2'
// annotation processors
annotationProcessor 'org.projectlombok:lombok'
}

Bean

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import lombok.Data;

@Entity
@Data
public class Product {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String name;
}

Please let me know what I am missing ?

enter image description here

0

There are 0 best solutions below