]> source.dussan.org Git - archiva.git/commitdiff
[MRM-804] Execute the repository content consumers for the uploaded or generated...
authorWendy Smoak <wsmoak@apache.org>
Sun, 18 May 2008 02:16:42 +0000 (02:16 +0000)
committerWendy Smoak <wsmoak@apache.org>
Sun, 18 May 2008 02:16:42 +0000 (02:16 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@657491 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/UploadAction.java

index 2f958a32c210259a3a7259c12d0931493302060a..4680125dfb6aad68644ffab887572618c4c94a3d 100644 (file)
@@ -316,6 +316,7 @@ public class UploadAction
             try
             {
                 copyFile( artifactFile, targetPath, artifactPath.substring( lastIndex + 1 ) );
+                consumers.executeConsumers( repoConfig, repository.toFile( artifactReference ) );
             }
             catch ( IOException ie )
             {
@@ -327,7 +328,8 @@ public class UploadAction
             {
                 try
                 {
-                    createPom( targetPath, artifactPath.substring( lastIndex + 1 ) );
+                    File generatedPomFile = createPom( targetPath, artifactPath.substring( lastIndex + 1 ) );
+                    consumers.executeConsumers( repoConfig, generatedPomFile );
                 }
                 catch ( IOException ie )
                 {
@@ -348,6 +350,7 @@ public class UploadAction
                 {
                     String targetFilename = artifactPath.substring( lastIndex + 1 ).replaceAll( packaging, "pom" );
                     copyFile( pomFile, targetPath, targetFilename );
+                    consumers.executeConsumers( repoConfig, new File( targetPath, targetFilename ) );
                 }
                 catch ( IOException ie )
                 {
@@ -368,8 +371,6 @@ public class UploadAction
             //TODO: MRM-785 (success message does not display on web page)
             addActionMessage( msg );
 
-            consumers.executeConsumers( repoConfig, repository.toFile( artifactReference ) );
-            
             return SUCCESS;
         }
         catch ( RepositoryNotFoundException re )
@@ -410,7 +411,7 @@ public class UploadAction
         }
     }
 
-    private void createPom( File targetPath, String filename )
+    private File createPom( File targetPath, String filename )
         throws IOException, ProjectModelException
     {
         ArchivaProjectModel projectModel = new ArchivaProjectModel();
@@ -422,6 +423,8 @@ public class UploadAction
         File pomFile = new File( targetPath, filename.replaceAll( packaging, "pom" ) );
 
         pomWriter.write( projectModel, pomFile );
+
+        return pomFile;
     }
 
     private File getMetadata( String targetPath )