Reputation: 1974
I am running a build with latest Gradle version (v4.6) in a project with a lot of classpath dependencies. I get:
Putting annotation processors on the compile classpath has been deprecated and is scheduled to be removed in Gradle 5.0. Please add them to the processor path instead.
How can I find the offending dependency/ies (in a reasonable way)?
Upvotes: 1
Views: 796
Reputation: 1974
The best way I found so far is to add-hoc the following code myself to the build script:
tasks.withType(JavaCompile) {
doFirst {
effectiveAnnotationProcessorPath.each { maybeJar ->
if (maybeJar.file) {
println "Doing: " + maybeJar.name
zipTree(maybeJar).matching {
include 'META-INF/services/javax.annotation.processing.Processor'
} each {
processorConfigFile ->
println "Annotation processor(s) found in $maybeJar.name:"
println processorConfigFile.filterLine { it =~ /^(?!#)/ }
}
}
}
}
}
(based on this Gradle forum answer)
Upvotes: 2