You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by br...@apache.org on 2006/02/13 02:16:42 UTC

svn commit: r377281 - /maven/sandbox/plugins/maven-one-plugin/src/main/java/org/apache/maven/plugins/mavenone/MavenOneRepositoryInstallMojo.java

Author: brett
Date: Sun Feb 12 17:16:40 2006
New Revision: 377281

URL: http://svn.apache.org/viewcvs?rev=377281&view=rev
Log:
attach artifacts on local installation as well

Modified:
    maven/sandbox/plugins/maven-one-plugin/src/main/java/org/apache/maven/plugins/mavenone/MavenOneRepositoryInstallMojo.java

Modified: maven/sandbox/plugins/maven-one-plugin/src/main/java/org/apache/maven/plugins/mavenone/MavenOneRepositoryInstallMojo.java
URL: http://svn.apache.org/viewcvs/maven/sandbox/plugins/maven-one-plugin/src/main/java/org/apache/maven/plugins/mavenone/MavenOneRepositoryInstallMojo.java?rev=377281&r1=377280&r2=377281&view=diff
==============================================================================
--- maven/sandbox/plugins/maven-one-plugin/src/main/java/org/apache/maven/plugins/mavenone/MavenOneRepositoryInstallMojo.java (original)
+++ maven/sandbox/plugins/maven-one-plugin/src/main/java/org/apache/maven/plugins/mavenone/MavenOneRepositoryInstallMojo.java Sun Feb 12 17:16:40 2006
@@ -30,6 +30,8 @@
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
 import java.util.Properties;
 
 /**
@@ -82,6 +84,13 @@
      */
     private ArtifactRepositoryLayout legacyLayout;
 
+    /**
+     * @parameter expression="${project.attachedArtifacts}
+     * @required
+     * @readonly
+     */
+    private List attachedArtifacts;
+
     public void execute()
         throws MojoExecutionException
     {
@@ -137,6 +146,16 @@
                 }
                 installer.install( file, artifact, localRepository );
             }
+
+            if ( attachedArtifacts != null && !attachedArtifacts.isEmpty() )
+            {
+                for ( Iterator i = attachedArtifacts.iterator(); i.hasNext(); )
+                {
+                    Artifact attached = (Artifact) i.next();
+
+                    installer.install( attached.getFile(), attached, localRepository );
+                }
+            }            
 
         }
         catch ( ArtifactInstallationException e )