From ef0763c2918f309d44d7cbf239db951e152235c4 Mon Sep 17 00:00:00 2001 From: Emmanuel Venisse Date: Mon, 3 Oct 2005 21:12:31 +0000 Subject: [PATCH] [MNG-1071] lookup archiver instead of calling contructor so output will be use with the correct logger. I forgot to modify these files git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@293450 13f79535-47bb-0310-9956-ffa450edef68 --- maven-plugins/maven-ear-plugin/pom.xml | 2 +- .../java/org/apache/maven/plugin/ear/EarMojo.java | 10 ++++++++++ maven-plugins/maven-ejb-plugin/pom.xml | 2 +- .../java/org/apache/maven/plugin/ejb/EjbMojo.java | 11 +++++++++++ maven-plugins/maven-rar-plugin/pom.xml | 2 +- .../java/org/apache/maven/plugin/rar/RarMojo.java | 10 ++++++++++ maven-plugins/maven-war-plugin/pom.xml | 2 +- .../java/org/apache/maven/plugin/war/WarMojo.java | 10 ++++++++-- 8 files changed, 43 insertions(+), 6 deletions(-) diff --git a/maven-plugins/maven-ear-plugin/pom.xml b/maven-plugins/maven-ear-plugin/pom.xml index 2db5129dc9..3af6fcc308 100644 --- a/maven-plugins/maven-ear-plugin/pom.xml +++ b/maven-plugins/maven-ear-plugin/pom.xml @@ -17,7 +17,7 @@ org.apache.maven maven-archiver - 2.0-beta-1 + 2.0-beta-3-SNAPSHOT plexus diff --git a/maven-plugins/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarMojo.java b/maven-plugins/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarMojo.java index caeaebc2b3..e0db307473 100644 --- a/maven-plugins/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarMojo.java +++ b/maven-plugins/maven-ear-plugin/src/main/java/org/apache/maven/plugin/ear/EarMojo.java @@ -19,6 +19,7 @@ package org.apache.maven.plugin.ear; import org.apache.maven.archiver.MavenArchiveConfiguration; import org.apache.maven.archiver.MavenArchiver; import org.apache.maven.plugin.MojoExecutionException; +import org.codehaus.plexus.archiver.jar.JarArchiver; import org.codehaus.plexus.util.FileUtils; import java.io.File; @@ -85,6 +86,14 @@ public class EarMojo */ private File resourcesDir; + /** + * The Jar archiver. + * + * @parameter expression="${component.org.codehaus.plexus.archiver.Archiver#jar}" + * @required + */ + private JarArchiver jarArchiver; + /** * The maven archiver to use. * @@ -173,6 +182,7 @@ public class EarMojo { File earFile = new File( outputDirectory, finalName + ".ear" ); MavenArchiver archiver = new MavenArchiver(); + archiver.setArchiver( jarArchiver ); archiver.setOutputFile( earFile ); // Include custom manifest if necessary diff --git a/maven-plugins/maven-ejb-plugin/pom.xml b/maven-plugins/maven-ejb-plugin/pom.xml index 1d04ba3837..542ae46935 100644 --- a/maven-plugins/maven-ejb-plugin/pom.xml +++ b/maven-plugins/maven-ejb-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-ejb-plugin/src/main/java/org/apache/maven/plugin/ejb/EjbMojo.java b/maven-plugins/maven-ejb-plugin/src/main/java/org/apache/maven/plugin/ejb/EjbMojo.java index 4c38904ceb..fb79de8999 100644 --- a/maven-plugins/maven-ejb-plugin/src/main/java/org/apache/maven/plugin/ejb/EjbMojo.java +++ b/maven-plugins/maven-ejb-plugin/src/main/java/org/apache/maven/plugin/ejb/EjbMojo.java @@ -22,6 +22,7 @@ import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.project.MavenProject; import org.apache.maven.project.MavenProjectHelper; +import org.codehaus.plexus.archiver.jar.JarArchiver; import java.io.File; @@ -87,6 +88,14 @@ public class EjbMojo */ private MavenProject project; + /** + * The Jar archiver. + * + * @parameter expression="${component.org.codehaus.plexus.archiver.Archiver#jar}" + * @required + */ + private JarArchiver jarArchiver; + /** * The maven project's helper. * @@ -117,6 +126,8 @@ public class EjbMojo MavenArchiver archiver = new MavenArchiver(); + archiver.setArchiver( jarArchiver ); + archiver.setOutputFile( jarFile ); String ejbJarXmlFile = "META-INF/ejb-jar.xml"; diff --git a/maven-plugins/maven-rar-plugin/pom.xml b/maven-plugins/maven-rar-plugin/pom.xml index 9fa9e42470..fe4821e87e 100644 --- a/maven-plugins/maven-rar-plugin/pom.xml +++ b/maven-plugins/maven-rar-plugin/pom.xml @@ -13,7 +13,7 @@ org.apache.maven maven-archiver - 2.0-beta-1 + 2.0-beta-3-SNAPSHOT org.apache.maven diff --git a/maven-plugins/maven-rar-plugin/src/main/java/org/apache/maven/plugin/rar/RarMojo.java b/maven-plugins/maven-rar-plugin/src/main/java/org/apache/maven/plugin/rar/RarMojo.java index 68678f7639..4ca48e4cc8 100644 --- a/maven-plugins/maven-rar-plugin/src/main/java/org/apache/maven/plugin/rar/RarMojo.java +++ b/maven-plugins/maven-rar-plugin/src/main/java/org/apache/maven/plugin/rar/RarMojo.java @@ -22,6 +22,7 @@ import org.apache.maven.archiver.MavenArchiver; import org.apache.maven.archiver.MavenArchiveConfiguration; import org.apache.maven.project.MavenProject; import org.apache.maven.artifact.Artifact; +import org.codehaus.plexus.archiver.jar.JarArchiver; import org.codehaus.plexus.util.FileUtils; import java.io.File; @@ -110,6 +111,14 @@ public class RarMojo */ private MavenProject project; + /** + * The Jar archiver. + * + * @parameter expression="${component.org.codehaus.plexus.archiver.Archiver#jar}" + * @required + */ + private JarArchiver jarArchiver; + /** * The maven archiver to use. * @@ -206,6 +215,7 @@ public class RarMojo { File rarFile = new File( outputDirectory, finalName + ".rar" ); MavenArchiver archiver = new MavenArchiver(); + archiver.setArchiver( jarArchiver ); archiver.setOutputFile( rarFile ); // Include custom manifest if necessary diff --git a/maven-plugins/maven-war-plugin/pom.xml b/maven-plugins/maven-war-plugin/pom.xml index dcf8a69439..5b9a638686 100644 --- a/maven-plugins/maven-war-plugin/pom.xml +++ b/maven-plugins/maven-war-plugin/pom.xml @@ -13,7 +13,7 @@ org.apache.maven maven-archiver - 2.0-beta-1 + 2.0-beta-3-SNAPSHOT org.apache.maven diff --git a/maven-plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarMojo.java b/maven-plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarMojo.java index 84f2bb36d6..1cada0fa1b 100644 --- a/maven-plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarMojo.java +++ b/maven-plugins/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/WarMojo.java @@ -130,6 +130,14 @@ public class WarMojo */ private String warName; + /** + * The Jar archiver. + * + * @parameter expression="${component.org.codehaus.plexus.archiver.Archiver#war}" + * @required + */ + private WarArchiver warArchiver; + /** * The maven archive configuration to use. * @@ -323,8 +331,6 @@ public class WarMojo MavenArchiver archiver = new MavenArchiver(); - WarArchiver warArchiver = new WarArchiver(); - archiver.setArchiver( warArchiver ); archiver.setOutputFile( warFile );