Provide better logging for RepackageMojo
Closes gh-15294
This commit is contained in:
@@ -336,14 +336,21 @@ public class RepackageMojo extends AbstractDependencyFilterMojo {
|
||||
attachArtifact(source, target);
|
||||
}
|
||||
else if (source.getFile().equals(target)) {
|
||||
getLog().info("Updating artifact " + source.getFile() + " to " + original);
|
||||
this.project.getArtifact().setFile(original);
|
||||
String artifactId = (this.classifier != null)
|
||||
? "artifact with classifier " + this.classifier : "main artifact";
|
||||
getLog().info(String.format("Updating %s %s to %s", artifactId,
|
||||
source.getFile(), original));
|
||||
source.setFile(original);
|
||||
}
|
||||
else if (this.classifier != null) {
|
||||
getLog().info("Creating repackaged archive " + target + " with classifier "
|
||||
+ this.classifier);
|
||||
}
|
||||
}
|
||||
|
||||
private void attachArtifact(Artifact source, File target) {
|
||||
if (this.classifier != null && !source.getFile().equals(target)) {
|
||||
getLog().info("Attaching archive " + target + " with classifier "
|
||||
getLog().info("Attaching repackaged archive " + target + " with classifier "
|
||||
+ this.classifier);
|
||||
this.projectHelper.attachArtifact(this.project, this.project.getPackaging(),
|
||||
this.classifier, target);
|
||||
@@ -351,7 +358,7 @@ public class RepackageMojo extends AbstractDependencyFilterMojo {
|
||||
else {
|
||||
String artifactId = (this.classifier != null)
|
||||
? "artifact with classifier " + this.classifier : "main artifact";
|
||||
getLog().info(String.format("Replacing %s %s", artifactId, source.getFile()));
|
||||
getLog().info("Replacing " + artifactId + " with repackaged archive");
|
||||
source.setFile(target);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user