]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1400] schedule repo scan after merging so metadata gets fixed
authorMaria Odea B. Ching <oching@apache.org>
Sun, 1 Aug 2010 05:09:02 +0000 (05:09 +0000)
committerMaria Odea B. Ching <oching@apache.org>
Sun, 1 Aug 2010 05:09:02 +0000 (05:09 +0000)
submitted by Patti Arachchige Eshan Sudharaka

git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/archiva-MRM-980@981152 13f79535-47bb-0310-9956-ffa450edef68

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

index 5c2cf7a0052883295d878a1c77f1c4c32cd6634b..0b9d439a77c6af7ae96898d5ab8112d778da262d 100644 (file)
@@ -31,6 +31,7 @@ import org.apache.archiva.metadata.repository.MetadataRepository;
 import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.configuration.Configuration;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
+import org.apache.maven.archiva.web.action.admin.SchedulerAction;
 
 import java.util.List;
 import java.util.ArrayList;
@@ -60,6 +61,11 @@ public class MergeAction
      */
     private MetadataRepository metadataRepository;
 
+    /**
+     * @plexus.requirement role="com.opensymphony.xwork2.Action" role-hint="schedulerAction"
+     */
+    private SchedulerAction scheduler;
+
     private ManagedRepositoryConfiguration repository;
 
     private String repoid;
@@ -100,7 +106,7 @@ public class MergeAction
         {
             List<ArtifactMetadata> sourceArtifacts = metadataRepository.getArtifacts( sourceRepoId );
             repositoryMerger.merge( sourceRepoId, repoid );
-            triggerAuditEvent( sourceRepoId, "file-eshan", AuditEvent.MERGING_REPOSITORIES );
+            scheduler.scanRepository();
 
             for ( ArtifactMetadata metadata : sourceArtifacts )
             {
@@ -127,6 +133,7 @@ public class MergeAction
             Filter<ArtifactMetadata> artifactsWithOutConflicts =
                 new IncludesFilter<ArtifactMetadata>( sourceArtifacts );
             repositoryMerger.merge( sourceRepoId, repoid, artifactsWithOutConflicts );
+            scheduler.scanRepository();
 
             for ( ArtifactMetadata metadata : sourceArtifacts )
             {
@@ -179,6 +186,7 @@ public class MergeAction
     {
         sourceRepoId = repoid + "-stage";
         conflictSourceArtifacts = repositoryMerger.getConflictsartifacts( sourceRepoId, repoid );
+        this.scheduler.setRepoid( repoid );
         this.repository = new ManagedRepositoryConfiguration();
         setConflictSourceArtifactsToBeDisplayed( conflictSourceArtifacts );
     }