lombok is installed but not working

Originally posted by @quangthangit in https://github.com/spring-projects/spring-boot/issues/40970#issuecomment-2146712261

Comment From: mhalbritter

Hello, without more information we unfortunately can't help you.

If you'd like us to spend some time investigating, please take the time to provide a complete minimal sample (something that we can unzip or git clone, build, and deploy) that reproduces the problem.

Comment From: quangthangit

Xin chào, không có thêm thông tin, rất tiếc chúng tôi không thể giúp bạn.

Nếu bạn muốn chúng tôi dành chút thời gian để điều tra, vui lòng dành thời gian để cung cấp một mẫu tối thiểu hoàn chỉnh (thứ mà chúng tôi có thể giải nén hoặc sao chép git, xây dựng và triển khai) tái tạo vấn đề.

I added and have the library in the project, @getter and @setter added and there is no error but when running it says there is no getter and setter

Comment From: mhalbritter

If you'd like us to spend some time investigating, please take the time to provide a complete minimal sample (something that we can unzip or git clone, build, and deploy) that reproduces the problem.

Comment From: codespearhead

@quangthangit I ran the following and got no errors in the terminal.

#!/bin/bash

mkdir demo \
&& cd demo \
&& curl https://start.spring.io/starter.zip \
    -d type=maven-project \
    -d dependencies=lombok \
    -o demo.zip \
&& unzip demo.zip \
&& rm demo.zip \
&& cat <<EOL > src/main/java/com/example/demo/Person.java
package com.example.demo;

import lombok.Getter;
import lombok.Setter;
import lombok.AllArgsConstructor;

@Getter
@Setter
@AllArgsConstructor
public class Person {
    private String name;
    private int age;
}
EOL

cat <<EOL > src/main/java/com/example/demo/DemoApplication.java
package com.example.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class DemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
        Person person = new Person("John Doe", 30);
        System.out.println();
        System.out.println("Name: " + person.getName());
        System.out.println("Age: " + person.getAge());
        System.out.println();
    }
}
EOL

./mvnw spring-boot:run
  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/

 :: Spring Boot ::                (v3.3.0)

2024-06-09T18:14:22.195-04:00  INFO 99766 --- [demo] [           main] com.example.demo.DemoApplication         : Starting DemoApplication using Java 21.0.3 with PID 99766 (/home/wsl/projects/deleteme/a/demo/target/classes started by wsl in /home/wsl/projects/deleteme/a/demo)
2024-06-09T18:14:22.198-04:00  INFO 99766 --- [demo] [           main] com.example.demo.DemoApplication         : No active profile set, falling back to 1 default profile: "default"
2024-06-09T18:14:22.934-04:00  INFO 99766 --- [demo] [           main] com.example.demo.DemoApplication         : Started DemoApplication in 1.246 seconds (process running for 1.625)

Name: John Doe
Age: 30

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  9.204 s
[INFO] Finished at: 2024-06-09T18:14:22-04:00
[INFO] ------------------------------------------------------------------------

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.