Sergej Koščejev
02/04/2025, 2:46 PMVampire
02/04/2025, 2:50 PMHEAD
request already.
And if it fails for anything but 404 I think the build should already fail.Sergej Koščejev
02/04/2025, 2:51 PMVampire
02/04/2025, 2:55 PMwithDependencies
action to all configurations. This action is done for each configuration right before it is first part of dependency resolution. In that action you could maybe - guarded by a count down latch - once check whether accessing the repository works and otherwise fail the build with a meaningful error right away.Sergej Koščejev
02/04/2025, 3:02 PMAdam
02/04/2025, 3:06 PMval checkErrors by tasks.registering {
val failures = provider {
configurations.create("foo") {
isCanBeConsumed = false
isCanBeResolved = true
isCanBeDeclared = false
extendsFrom(configurations.implementation)
}
.incoming
.artifactView { }
.artifacts
.failures
}
doLast {
failures.orNull.orEmpty().forEach {
if (it.message?.contains("credential error...") == true) {
error("Refresh your credentials!")
}
}
}
}
Sergej Koščejev
02/04/2025, 3:07 PMVampire
02/04/2025, 3:10 PMThat would be similar to adding a DependencyResolutionListener to the build, wouldn’t it?Probably 😄
Vampire
02/04/2025, 3:10 PM