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 2018/11/26 15:15:54 UTC

[karaf] branch karaf-4.1.x updated: [KARAF-5939] Attach correct artifact to the archive project

This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch karaf-4.1.x
in repository https://gitbox.apache.org/repos/asf/karaf.git


The following commit(s) were added to refs/heads/karaf-4.1.x by this push:
     new cd1b8a9  [KARAF-5939] Attach correct artifact to the archive project
cd1b8a9 is described below

commit cd1b8a99869885614785f85699437b57b23ba6d1
Author: Jean-Baptiste Onofré <jb...@apache.org>
AuthorDate: Mon Nov 26 16:15:05 2018 +0100

    [KARAF-5939] Attach correct artifact to the archive project
---
 .../src/main/java/org/apache/karaf/tooling/ArchiveMojo.java         | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

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 2e03ba7..f8a561a 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
@@ -113,6 +113,8 @@ public class ArchiveMojo extends MojoSupport {
     private boolean useSymLinks = false;
 
     public void execute() throws MojoExecutionException, MojoFailureException {
+        org.apache.maven.artifact.Artifact artifact = project.getArtifact();
+        artifact.setFile(targetFile);
         try {
             //now pack up the server.
             if(archiveTarGz){
@@ -144,8 +146,8 @@ public class ArchiveMojo extends MojoSupport {
             projectHelper.attachArtifact(project, artifact1.getType(), classifier, target1);
         }
 
-        artifact1.setFile(target1);
-        project.setArtifact(artifact1);
+        artifact2.setFile(target1);
+        project.setArtifact(artifact2);
     }
 
     public File archive(File source, File dest, Artifact artifact) throws //ArchiverException,