Skip to content

Commit

Permalink
Reword error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
cstamas committed May 28, 2024
1 parent 8ead1c4 commit efbf700
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,9 @@ public void execute() throws MojoExecutionException {
if (extraJars != null && !extraJars.isEmpty()) {
for (File extraJar : extraJars) {
if (!Files.isRegularFile(extraJar.toPath())) {
createErrorOutput();
throw new MojoExecutionException("Failed to create shaded artifact, "
+ "extra JAR artifact does not exist: " + extraJar);
throw new MojoExecutionException(
"Failed to create shaded artifact: parameter extraJars contains path " + extraJar
+ " that is not a file (does not exist or is not a file)");
}
artifacts.add(extraJar);
}
Expand Down Expand Up @@ -745,7 +745,10 @@ private void processArtifactSelectors(
artifact.setFile(resolved.getFile());
}
} catch (ArtifactResolutionException e) {
throw new MojoExecutionException("Could not resolve artifact " + artifact.getId(), e);
throw new MojoExecutionException(
"Failed to create shaded artifact: parameter extraArtifacts contains artifact "
+ artifact.getId() + " that is not resolvable",
e);
}
}
}
Expand Down

0 comments on commit efbf700

Please sign in to comment.