Skip to content
Permalink
Browse files
Throw an exception when a dependency fails to resolve
  • Loading branch information
spark404 committed Apr 16, 2015
1 parent 48db284 commit 6c7770ccca2ccfaa752d469ae69252f57106f6d9
Showing 1 changed file with 5 additions and 2 deletions.
@@ -258,7 +258,7 @@ public void execute() throws MojoExecutionException {
}
}

private List<File> resolve(String artifactDescriptor) {
private List<File> resolve(String artifactDescriptor) throws MojoExecutionException {
String[] s = artifactDescriptor.split(":");

String type = s.length >= 4 ? s[3] : "jar";
@@ -281,7 +281,10 @@ private List<File> resolve(String artifactDescriptor) {
ArtifactResolutionResult result = repository.resolve(request);
List<File> files = new ArrayList<File>();
for (Artifact a : result.getArtifacts()) {
files.add(a.getFile());
if (a.getFile() == null) {
throw new MojoExecutionException("Unable to resolve " + a.toString()
+ " while resolving " + artifactDescriptor);
}
}
if (!files.contains(artifact.getFile())) {
files.add(artifact.getFile());

0 comments on commit 6c7770c

Please sign in to comment.