gpt4 book ai didi

java - 如何找到提供注释处理器的依赖项

转载 作者:行者123 更新时间:2023-12-02 11:28:30 24 4
gpt4 key购买 nike

我正在一个具有大量类路径依赖项的项目中运行最新 Gradle 版本 (v4.6) 的构建。我得到:

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.

我怎样才能找到有问题的依赖项(以合理的方式)?

最佳答案

到目前为止,我发现的最好方法是将以下代码自己添加到构建脚本中:

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 =~ /^(?!#)/ }
}
}
}
}
}

(基于 this Gradle forum answer )

关于java - 如何找到提供注释处理器的依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49457357/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com