Intellij无法识别Java Spring-Boot的lombok设置程序

I am using IntelliJ on Ubuntu (runtime version 11.0.5) and currently I am building a Spring-Boot application. I am using the lombok plugin in order to generate getters and setters for my entity automatically. This is how my code looks like currently:

public class Experts {

    private final String id;

    private final String name;
    private final String desc;

    private final Availability availability;

    private final Language language;



public class ExpertsServiceImpl implements ExpertsService{

    private final ExpertRepository repository;

    public Experts updateExpert(Experts expert, String id) {
        Experts updated = findExpertById(id);
        if(updated == null) {
            throw new ExpertNotFoundException(id);

        updated.setId(expert.getId()); // here is shows: Cannot resolve method 'setId' in 'Experts';
        return updated;


enter image description here


  • Peter
    Peter 回复

    Your id is final lombok will only generate setters for fields that can be set.