How to resolve lombok's error under intellij idea in the spring boot project? - Stack Overflow

admin2025-04-26  6

I'm working on a simple Spring Boot project where I have used sping web and lombok dependency. In the model class I have used lombok annotation instead of creating constractor, getter and setter manually. But unfortunaty I am encountering an issue with the following error:

D:\Downloads\springwiththymefeaf\springwiththymefeaf\src\main\java\com\petproject\springwiththymefeaf\controller\TaskController.java:13:21 
java: constructor Task in class com.petproject.springwiththymefeaf.model.Task cannot be applied to given types; 
  required: no arguments 
  found:    int,java.lang.String,boolean 
  reason: actual and formal argument lists differ in length

here is the Task model:

package com.petproject.springwiththymefeaf.model;

import lombok.*;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Task {
    private int id;
    private String title;
    private boolean completed;
}

I'm using IntelliJ IDEA and have taken the following steps to resolve it:

  1. Checked and reinstalled the Lombok plugin.
  2. Enabled annotation processing in the settings.
  3. Updated to the latest version of Lombok.

Despite these efforts, the error persists. Interestingly, the same project runs without issues in Visual Studio Code.

What can I do to resolve this problem in IntelliJ IDEA?

转载请注明原文地址:http://anycun.com/QandA/1745600283a91012.html