werwuifi
werwuifi

Reputation: 409

Could not find method lombok() for arguments

Just wanted to include the lombok plugin with my gradle build but get the error message from the title. My build.gradle looks like this:

...
plugins {
    id 'net.ltgt.apt' version '0.10'
}
ext {
    lombok_version="1.16.18"
}
lombok {
    version = ${lombok_version}
    sha256 = ""
}
...
dependencies {
    ...    
    compileOnly "org.projectlombok:lombok:${lombok_version}"
    apt "org.projectlombok:lombok:${lombok_version}"
    ...
}

Source: https://projectlombok.org/setup/gradle

Any ideas what's wrong here? If I remove the lombok {...} part everything works fine.

Upvotes: 8

Views: 9128

Answers (1)

Roel Spilker
Roel Spilker

Reputation: 34572

According to the documentation you should use either

lombok {
    version = "1.16.18"
    sha256 = ""
}

or

dependencies {
    compileOnly 'org.projectlombok:lombok:1.16.18'
    apt "org.projectlombok:lombok:1.16.18"
}

Disclosure: I am a lombok developer.

Upvotes: 7

Related Questions