karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject karaf git commit: [KARAF-4462] Allow control of attachment in the archive mojo
Date Tue, 09 Aug 2016 14:19:56 GMT
Repository: karaf
Updated Branches:
  refs/heads/karaf-4.0.x 33f57704e -> 606161670


[KARAF-4462] Allow control of attachment in the archive mojo


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/60616167
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/60616167
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/60616167

Branch: refs/heads/karaf-4.0.x
Commit: 60616167055fcedd37c1e9bddc299cdb0b6564db
Parents: 33f5770
Author: Benson Margulies <benson@basistech.com>
Authored: Fri Apr 1 19:27:03 2016 -0400
Committer: Jean-Baptiste Onofré <jbonofre@apache.org>
Committed: Tue Aug 9 16:19:49 2016 +0200

----------------------------------------------------------------------
 .../java/org/apache/karaf/tooling/ArchiveMojo.java  | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/60616167/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/ArchiveMojo.java
----------------------------------------------------------------------
diff --git a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/ArchiveMojo.java
b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/ArchiveMojo.java
index c8362ac..de8b093 100644
--- a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/ArchiveMojo.java
+++ b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/ArchiveMojo.java
@@ -91,6 +91,18 @@ public class ArchiveMojo extends MojoSupport {
     private boolean archiveZip = true;
 
     /**
+     * Whether to attach the resulting assembly to the project as an artifact.
+     */
+    @Parameter(defaultValue="true")
+    private boolean attach = true;
+
+    /**
+     * If supplied, the classifer for the artifact when attached.
+     */
+    @Parameter
+    private String classifier;
+
+    /**
      * use symbolic links in tar.gz or zip archives
      *
      * Symbolic links are not very well supported by windows Platform.
@@ -121,7 +133,9 @@ public class ArchiveMojo extends MojoSupport {
 	private void archive(String type) throws IOException {
         Artifact artifact1 = factory.createArtifactWithClassifier(project.getArtifact().getGroupId(),
project.getArtifact().getArtifactId(), project.getArtifact().getVersion(), type, "bin");
         File target1 = archive(targetServerDirectory, destDir, artifact1);
-        projectHelper.attachArtifact( project, artifact1.getType(), null, target1 );
+        if (attach) {
+            projectHelper.attachArtifact(project, artifact1.getType(), classifier, target1);
+        }
     }
 
     public File archive(File source, File dest, Artifact artifact) throws //ArchiverException,


Mime
View raw message