You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2016/08/22 09:30:36 UTC
[38/50] [abbrv] karaf git commit: [KARAF-4462] Allow control of
attachment in the archive mojo
[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/3e7e0c7b
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/3e7e0c7b
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/3e7e0c7b
Branch: refs/heads/master
Commit: 3e7e0c7b8bbe33f39acada2e712abe4c4a2e5396
Parents: b57db85
Author: Benson Margulies <be...@basistech.com>
Authored: Fri Apr 1 19:27:03 2016 -0400
Committer: Jean-Baptiste Onofr� <jb...@apache.org>
Committed: Mon Aug 22 11:29:21 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/3e7e0c7b/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,