question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lombok integration stops working if lombok is included as gradle's compileOnly

See original GitHub issue

If 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:closed
  • Created 7 years ago
  • Comments:13

github_iconTop GitHub Comments

4reactions
bensullivancommented, Oct 7, 2016

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

3reactions
victorsmirnovcommented, Nov 3, 2017

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 as compileOnly, enabled annotations and it compiled like I expected with getters and setters.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found