-
FAILURE: Build failed with an exception.
While using NullAway, we get this error.. any clues |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Changed
to this tasks.withType { It is working now.. documents this way are to be corrected as they give the first snippet.. Any case author pl. confirm the proposed gradle configuration is correct.. |
Beta Was this translation helpful? Give feedback.
-
You might want to use my Further improvements:
With all those applied, you'd have something like: nullaway {
annotatedPackages.add("com.tejasoft")
}
tasks {
withType<JavaCompile>().configureEach {
options.errorprone.disableWarningsInGeneratedCode.set(true)
}
compileJava {
options.errorprone.nullaway.error()
}
} (fwiw, I prefer nesting everything: |
Beta Was this translation helpful? Give feedback.
You might want to use my
net.ltgt.nullaway
plugin to make it even easier to configure, but indeed changingconfigure<ErrorProneOptions>
tooptions.errorprone
is the right thing to do, as theErrorProneOptions
extension is added to theoptions
object, not theJavaCompile
task itself.Further improvements:
withType<JavaCompile>().configureEach {
: https://docs.gradle.org/current/userguide/task_configuration_avoidance.htmlcompileJava
task rather than excluding the test tasksWith all those applied, you'd have something like: