continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r388170 - in /maven/continuum/branches/continuum-1.0.x/continuum-core/src/main: java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java resources/META-INF/plexus/components.xml
Date Thu, 23 Mar 2006 13:38:32 GMT
Author: evenisse
Date: Thu Mar 23 05:38:29 2006
New Revision: 388170

URL: http://svn.apache.org/viewcvs?rev=388170&view=rev
Log:
Add deployment of *-sources, *-javadoc, *-client, *-tests artifacts if they are generated
by maven.

Modified:
    maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
    maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/resources/META-INF/plexus/components.xml

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=388170&r1=388169&r2=388170&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 05:38:29 2006
@@ -25,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.MavenProjectHelper;
 import org.apache.maven.project.artifact.ProjectArtifactMetadata;
 import org.codehaus.plexus.util.StringUtils;
 
@@ -57,6 +58,11 @@
      */
     private MavenBuilderHelper builderHelper;
 
+    /**
+     * @plexus.requirement
+     */
+    private MavenProjectHelper projectHelper;
+
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
@@ -163,7 +169,9 @@
 
         Artifact artifact = project.getArtifact();
 
-        boolean isPomArtifact = "pom".equals( project.getPackaging() );
+        String projectPackaging = project.getPackaging();
+
+        boolean isPomArtifact = "pom".equals( projectPackaging );
 
         if ( isPomArtifact )
         {
@@ -176,9 +184,47 @@
 
             artifact.addMetadata( metadata );
 
-            String filename = project.getBuild().getFinalName() + "." + artifact.getArtifactHandler().getExtension();
+            String finalName = project.getBuild().getFinalName();
+
+            String filename = finalName + "." + artifact.getArtifactHandler().getExtension();
+
+            String buildDirectory = project.getBuild().getDirectory();
+
+            File artifactFile = new File( buildDirectory, filename );
+
+            artifact.setFile( artifactFile );
+
+            // sources jar
+            File sourcesFile = new File( buildDirectory, finalName + "-sources.jar" );
+
+            if ( sourcesFile.exists() )
+            {
+                projectHelper.attachArtifact( project, "java-source", "sources", sourcesFile
);
+            }
+
+            // javadoc jar
+            File javadocFile = new File( buildDirectory, finalName + "-javadoc.jar" );
+
+            if ( javadocFile.exists() )
+            {
+                projectHelper.attachArtifact( project, "javadoc", "javadoc", javadocFile
);
+            }
+
+            // client jar
+            File clientFile = new File( buildDirectory, finalName + "-client.jar" );
 
-            artifact.setFile( new File( project.getBuild().getDirectory(), filename ) );
+            if ( clientFile.exists() )
+            {
+                projectHelper.attachArtifact( project, projectPackaging + "-client", "client",
clientFile );
+            }
+
+            // Tests jar
+            File testsFile = new File( buildDirectory, finalName + "-tests.jar" );
+
+            if ( testsFile.exists() )
+            {
+                projectHelper.attachArtifact( project, "jar", "tests", testsFile );
+            }
         }
 
         if ( artifact.getFile().exists() )

Modified: maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/resources/META-INF/plexus/components.xml?rev=388170&r1=388169&r2=388170&view=diff
==============================================================================
--- maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/resources/META-INF/plexus/components.xml
(original)
+++ maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/resources/META-INF/plexus/components.xml
Thu Mar 23 05:38:29 2006
@@ -243,6 +243,9 @@
         <requirement>
           <role>org.apache.maven.continuum.utils.WorkingDirectoryService</role>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.project.MavenProjectHelper</role>
+        </requirement>
       </requirements>
     </component>
 



Mime
View raw message