From 82b51f34ac151c074b75f8d2c6acfa08518dec04 Mon Sep 17 00:00:00 2001 From: Wendy Smoak Date: Sun, 18 May 2008 02:16:42 +0000 Subject: [PATCH] [MRM-804] Execute the repository content consumers for the uploaded or generated pom file so that artifacts will be available in search and browse immediately after uploading. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@657491 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/archiva/web/action/UploadAction.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/UploadAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/UploadAction.java index 2f958a32c..4680125df 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/UploadAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/UploadAction.java @@ -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 ) -- 2.39.5