From: Maria Odea B. Ching Date: Sun, 1 Aug 2010 05:09:02 +0000 (+0000) Subject: [MRM-1400] schedule repo scan after merging so metadata gets fixed X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=406f496d260dfaddd28610df0c630cfe576e7087;p=archiva.git [MRM-1400] schedule repo scan after merging so metadata gets fixed 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 --- diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/MergeAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/MergeAction.java index 5c2cf7a00..0b9d439a7 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/MergeAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/MergeAction.java @@ -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 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 artifactsWithOutConflicts = new IncludesFilter( 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 ); }