Lombok integration stops working if lombok is included as gradle's compileOnly
See original GitHub issueIf I use a (new in Gradle 2.12) compileOnly dependency to include Lombok in my project, the Gradle build succeeds but the IntelliJ one does not, failing on all Lombok generated code.
dependencies {
compile group: 'org.projectlombok', name: 'lombok', version: '1.16.8'
}
works, but
dependencies {
compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.16.8'
testCompileOnly group: 'org.projectlombok', name: 'lombok', version: '1.16.8'
}
does not
Issue Analytics
- State:
- Created 7 years ago
- Comments:13
Top Results From Across the Web
Developers - Lombok integration stops working if lombok is included ...
If I use a (new in Gradle 2.12) compileOnly dependency to include Lombok in my project, the Gradle build succeeds but the IntelliJ...
Read more >Gradle build fails on Lombok annotated classes - Stack Overflow
I had the same problem and worked for me when added to build.gradle: dependencies{ compileOnly 'org.projectlombok:lombok:1.18.8' annotationProcessor ...
Read more >Gradle - Project Lombok
This page explains how to integrate lombok with the Gradle build tool. Lombok is available in maven central, so telling Gradle to download...
Read more >Using Lombok in a Spring Boot project with IntelliJ | Bootify.io
To use Lombok, first the dependency must be included in the build.gradle or pom.xml . Here the annotation processor is especially important, ...
Read more >When Should I Use Project Lombok? - Reflectoring
Install the Lombok plugin and restart Eclipse. ... It makes the Lombok libraries available to the compiler but is not a ... With...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I am seeing this too on Ubuntu 16.04:
IntelliJ IDEA 2016.2.4 Build #IC-162.2032.8, built on September 9, 2016 JRE: 1.8.0_112-release-b343 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
I had faced the issue which looks like this one because I forgot to enable annotation processing in IntelliJ IDEA. It is described for example here in SO - Lombok annotations do not compile under Intellij idea. So I’m putting this note in a hope it might help other people who are absent-minded like me and find this while googling for the issue.
When I build the project in IntelliJ IDEA 2017.3 public preview without annotation processing enabled it looks like getters are setters are not created by
@Data
annotation.I kept
Lombok
dependency ascompileOnly
, enabled annotations and it compiled like I expected with getters and setters.