makozaki
makozaki

Reputation: 4366

Lombok stops working after gradle upgrade

My build.gradle contains dependency:

...
testCompile group: 'org.projectlombok', name: 'lombok', version: '1.18.12'
...

When I upgrade my gradle from 4.9 to 6.6.1 I get errors:

required: no arguments
found: ...
reason: actual and formal argument list differ in length

All my classes that use @AllArgsConstructor are failing on compileTestJava gradle step. Anyone has a clue why?

Upvotes: 1

Views: 395

Answers (2)

gghnisan
gghnisan

Reputation: 11

I'll add to the answer. Here is the link to the documentation: https://projectlombok.org/setup/gradle

Doesn't work for me without apt.

It worked for me like this:

    compileOnly("org.projectlombok:lombok:1.18.28")
    apt annotationProcessor("org.projectlombok:lombok:1.18.28")
    testCompileOnly("org.projectlombok:lombok:1.18.28")
    apt testAnnotationProcessor("org.projectlombok:lombok:1.18.28")

Upvotes: 0

Michał Krzywański
Michał Krzywański

Reputation: 16920

You should also add lombok in testAnnotationProcessor :

testAnnotationProcessor 'org.projectlombok:lombok:1.18.12'

Also adjust the version as you need.

Upvotes: 1

Related Questions