dependencies {
test "com.test:testA:1.0@jar"
test "com.test:testB:1.0@jar"
}
task('collectArtifacts', type: Copy) {
from project.configurations.test
into 'artifacts/'
}
假设 artifact testA 丢失,testB 可用。
当我使用 ./gradlew collectArtifacts 命令时,它显然会报错,提示“> 找不到 com.test:testA:1.0”。
我该如何让 gradle 实现以下两点要求:
- 如果 testA 存在,则下载 testA 和 testB - 如果 testA 不存在,则忽略对 testA 依赖的解析错误,直接下载 testB。