continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r388141 - /maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
Date Thu, 23 Mar 2006 11:04:54 GMT
Author: evenisse
Date: Thu Mar 23 03:04:44 2006
New Revision: 388141

URL: http://svn.apache.org/viewcvs?rev=388141&view=rev
Log:
[CONTINUUM-633] Deploy pom to internal repository

Modified:
    maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java

Modified: maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
URL: http://svn.apache.org/viewcvs/maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java?rev=388141&r1=388140&r2=388141&view=diff
==============================================================================
--- maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
(original)
+++ maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
Thu Mar 23 03:04:44 2006
@@ -17,6 +17,7 @@
  */
 
 import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.metadata.ArtifactMetadata;
 import org.apache.maven.continuum.execution.AbstractBuildExecutor;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutionResult;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
@@ -24,6 +25,7 @@
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.artifact.ProjectArtifactMetadata;
 import org.codehaus.plexus.util.StringUtils;
 
 import java.io.File;
@@ -143,6 +145,7 @@
         }
 
         MavenProject project;
+
         try
         {
             project = builderHelper.getMavenProject( f );
@@ -157,16 +160,32 @@
 
         // Maven could help us out a lot more here by knowing how to get the deployment artifacts
from a project.
         // TODO: this is currently quite lame
-        if ( !"pom".equals( project.getPackaging() ) )
+
+        Artifact artifact = project.getArtifact();
+
+        boolean isPomArtifact = "pom".equals( project.getPackaging() );
+
+        if ( isPomArtifact )
         {
-            Artifact artifact = project.getArtifact();
+            artifact.setFile( project.getFile() );
+        }
+        else
+        {
+            // Attach pom
+            ArtifactMetadata metadata = new ProjectArtifactMetadata( artifact, project.getFile()
);
+
+            artifact.addMetadata( metadata );
+
             String filename = project.getBuild().getFinalName() + "." + artifact.getArtifactHandler().getExtension();
+
             artifact.setFile( new File( project.getBuild().getDirectory(), filename ) );
-            if ( artifact.getFile().exists() )
-            {
-                artifacts.add( artifact );
-            }
         }
+
+        if ( artifact.getFile().exists() )
+        {
+            artifacts.add( artifact );
+        }
+
         return artifacts;
     }
 }



Mime
View raw message