You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by rz...@apache.org on 2022/04/16 04:53:55 UTC
[tomee-patch-plugin] branch master updated: TOMEE-3903 - Allow the user to configure, if *.tar.gz files should be attached or not. For TomEE build attaching an *.tar.gz files is done twice leading to undefined Maven deploy behaviour.
This is an automated email from the ASF dual-hosted git repository.
rzo1 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee-patch-plugin.git
The following commit(s) were added to refs/heads/master by this push:
new 393646b TOMEE-3903 - Allow the user to configure, if *.tar.gz files should be attached or not. For TomEE build attaching an *.tar.gz files is done twice leading to undefined Maven deploy behaviour.
393646b is described below
commit 393646ba38f8b94bc287d4283af90a4ed3a8d8d9
Author: Richard Zowalla <ri...@hs-heilbronn.de>
AuthorDate: Wed Apr 13 18:29:16 2022 +0200
TOMEE-3903 - Allow the user to configure, if *.tar.gz files should be attached or not. For TomEE build attaching an *.tar.gz files is done twice leading to undefined Maven deploy behaviour.
---
.../java/org/apache/tomee/patch/plugin/PatchMojo.java | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/tomee-patch-plugin/src/main/java/org/apache/tomee/patch/plugin/PatchMojo.java b/tomee-patch-plugin/src/main/java/org/apache/tomee/patch/plugin/PatchMojo.java
index 192e54a..bb97aef 100644
--- a/tomee-patch-plugin/src/main/java/org/apache/tomee/patch/plugin/PatchMojo.java
+++ b/tomee-patch-plugin/src/main/java/org/apache/tomee/patch/plugin/PatchMojo.java
@@ -189,6 +189,9 @@ public class PatchMojo extends AbstractMojo {
@Parameter(defaultValue = "false")
private Boolean transformSources;
+ @Parameter(defaultValue = "false")
+ private Boolean attach;
+
/**
* Sets the executable of the compiler to use when fork is <code>true</code>.
*/
@@ -299,11 +302,13 @@ public class PatchMojo extends AbstractMojo {
continue;
}
- final String classifier = artifact.getClassifier();
- final AttachedArtifact attachedArtifact = new AttachedArtifact(project.getArtifact(), "tar.gz", classifier, project.getArtifact().getArtifactHandler());
- attachedArtifact.setFile(tarGz);
- attachedArtifact.setResolved(true);
- project.addAttachedArtifact(attachedArtifact);
+ if(attach) {
+ final String classifier = artifact.getClassifier();
+ final AttachedArtifact attachedArtifact = new AttachedArtifact(project.getArtifact(), "tar.gz", classifier, project.getArtifact().getArtifactHandler());
+ attachedArtifact.setFile(tarGz);
+ attachedArtifact.setResolved(true);
+ project.addAttachedArtifact(attachedArtifact);
+ }
}
}