mirror of
https://github.com/ethauvin/bld.git
synced 2025-04-26 00:37:10 -07:00
Improve artifact not found exception to explicitly mention that no repositories or no artifact locations are defined.
This commit is contained in:
parent
f0129e7ba1
commit
57c4b20de8
1 changed files with 20 additions and 2 deletions
|
@ -365,7 +365,16 @@ public class DependencyResolver {
|
|||
}
|
||||
|
||||
if (metadata == null) {
|
||||
throw new ArtifactNotFoundException(dependency_, artifacts.stream().map(RepositoryArtifact::location).collect(Collectors.joining(", ")));
|
||||
var location = artifacts.stream().map(RepositoryArtifact::location).collect(Collectors.joining(", "));
|
||||
if (location.isEmpty()) {
|
||||
if (repositories_.isEmpty()) {
|
||||
location = "[no repositories defined]";
|
||||
}
|
||||
else {
|
||||
location = "[no metadata locations defined]";
|
||||
}
|
||||
}
|
||||
throw new ArtifactNotFoundException(dependency_, location);
|
||||
}
|
||||
|
||||
var xml = new Xml2MavenMetadata();
|
||||
|
@ -414,7 +423,16 @@ public class DependencyResolver {
|
|||
}
|
||||
|
||||
if (pom == null) {
|
||||
throw new ArtifactNotFoundException(dependency_, artifacts.stream().map(RepositoryArtifact::location).collect(Collectors.joining(", ")));
|
||||
var location = artifacts.stream().map(RepositoryArtifact::location).collect(Collectors.joining(", "));
|
||||
if (location.isEmpty()) {
|
||||
if (repositories_.isEmpty()) {
|
||||
location = "[no repositories defined]";
|
||||
}
|
||||
else {
|
||||
location = "[no pom locations defined]";
|
||||
}
|
||||
}
|
||||
throw new ArtifactNotFoundException(dependency_, location);
|
||||
}
|
||||
|
||||
var xml = new Xml2MavenPom(parent, retriever_, repositories_);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue