DEV Community

Ramya K
Ramya K

Posted on

How to enable lombok in Spring tool suite?

Lombok is used to reduce boiler plate code.

Step:1.Create project with Lombok as a dependency.
Step:2 Once it is created open Maven dependency from Project Explorer

Image description

Step:3. Copy paste that path lombok path in the windows explorer. Find lombok executable file double click it.

Image description

Step:4. Click Specific location and find the springtoolsuite initialization software where you have installed in your system then install then quit Installer

Image description

Image description
Step:5. Close and reopen SpringToolSuite(STS) once.

Now Lombok will work fine in your STS. Without any error it works very well.

package com.courseapp.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

@NoArgsConstructor
@AllArgsConstructor
@data
//@Getter
//@setter
//@ToString
public class Course {

private String courseName;
private Integer courseId;
private String type; 
private double cost;
private int durationInWeeks;
Enter fullscreen mode Exit fullscreen mode

}

Top comments (0)