From bcbdec74fc4d10615fe8444a3a6e4ee690f63af4 Mon Sep 17 00:00:00 2001 From: Emmanuel Venisse Date: Mon, 3 Oct 2005 09:48:32 +0000 Subject: [PATCH] [MNG-1071] lookup JarArchiver instead of calling contructor so output will be use with the correct logger. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@293285 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/maven/archiver/MavenArchiver.java | 2 +- maven-plugins/maven-jar-plugin/pom.xml | 2 +- .../org/apache/maven/plugin/jar/AbstractJarMojo.java | 11 +++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/maven-archiver/src/main/java/org/apache/maven/archiver/MavenArchiver.java b/maven-archiver/src/main/java/org/apache/maven/archiver/MavenArchiver.java index 2df1720b3d..fd1a3c7405 100644 --- a/maven-archiver/src/main/java/org/apache/maven/archiver/MavenArchiver.java +++ b/maven-archiver/src/main/java/org/apache/maven/archiver/MavenArchiver.java @@ -42,7 +42,7 @@ import java.util.Set; */ public class MavenArchiver { - private JarArchiver archiver = new JarArchiver(); + private JarArchiver archiver; private File archiveFile; diff --git a/maven-plugins/maven-jar-plugin/pom.xml b/maven-plugins/maven-jar-plugin/pom.xml index 2449a40f0b..414936b5ea 100644 --- a/maven-plugins/maven-jar-plugin/pom.xml +++ b/maven-plugins/maven-jar-plugin/pom.xml @@ -17,7 +17,7 @@ org.apache.maven maven-archiver - 2.0-beta-1 + 2.0-beta-3-SNAPSHOT \ No newline at end of file diff --git a/maven-plugins/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java b/maven-plugins/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java index f63c6caa22..727a1e5340 100644 --- a/maven-plugins/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java +++ b/maven-plugins/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java @@ -21,6 +21,7 @@ import org.apache.maven.archiver.MavenArchiver; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.archiver.jar.JarArchiver; import java.io.File; @@ -57,6 +58,14 @@ public abstract class AbstractJarMojo */ private String finalName; + /** + * The Jar archiver. + * + * @parameter expression="${component.org.codehaus.plexus.archiver.Archiver#jar}" + * @required + */ + private JarArchiver jarArchiver; + /** * The maven project. * @@ -114,6 +123,8 @@ public abstract class AbstractJarMojo MavenArchiver archiver = new MavenArchiver(); + archiver.setArchiver( jarArchiver ); + archiver.setOutputFile( jarFile ); try