2

I am trying to generate war of spring boot application and using lombok for getter setter. Running gradle build command from terminal and getting error in all getter setter and constructors ie. can not find symbol. I am using STS and able run project successfully from sts. but from command line it throws 100s of errors. I have lombok dependency in gradle file.

Please help me to resolve this issue.

Thanks

1

1 Answer 1

8

It seems you need to set preprocessor for annotations in your build.gradle file. In STS or IntelliJ, the IDEs provide preprocessing for annotations. However when you want to build via command, you need to specify it in the build.gradle config.

dependencies {
    annotationProcessor("org.projectlombok:lombok")
    compileOnly("org.projectlombok:lombok")
}

Hope it helps! Happy Coding. :)

4
  • I have already added above two things in build.gradle still it is same.
    – Anjali
    Sep 28, 2018 at 5:02
  • I used gradle lombok plugin after that error are gone for getter and setter but now giving some new message Caused by: java.lang.ClassNotFoundException: com.sun.tools.javac.code.TypeTags
    – Anjali
    Sep 28, 2018 at 6:04
  • It might be caused by the version conflict of lombok and JDK. Which version of JDK do you use?
    – john koo
    Sep 28, 2018 at 7:05
  • jdk10 and lombok1.16.22
    – Anjali
    Sep 28, 2018 at 10:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.