From 78087e7d08964183311ce8c0a4df6efb7302eea1 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 20 Sep 2012 22:51:27 +0000 Subject: [PATCH] add a new field in managed repository to store staging is needed to prevent stage repo remove when updating. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1388251 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/mdo/configuration.mdo | 9 +++++++++ .../managed/DefaultManagedRepositoryAdmin.java | 10 +++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo b/archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo index bcc007dd0..3d6365d77 100644 --- a/archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo +++ b/archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo @@ -657,6 +657,15 @@ false + + stageRepoNeeded + 1.0.0+ + boolean + + Need a staging repository + + false + diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java index a8d0fc73e..b28b7435a 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java @@ -66,12 +66,11 @@ import java.util.List; import java.util.Map; /** - * * FIXME review the staging mechanism to have a per user session one * * @author Olivier Lamy */ -@Service ("managedRepositoryAdmin#default") +@Service ( "managedRepositoryAdmin#default" ) public class DefaultManagedRepositoryAdmin extends AbstractRepositoryAdmin implements ManagedRepositoryAdmin @@ -82,7 +81,7 @@ public class DefaultManagedRepositoryAdmin public static final String STAGE_REPO_ID_END = "-stage"; @Inject - @Named (value = "archivaTaskScheduler#repository") + @Named ( value = "archivaTaskScheduler#repository" ) private RepositoryArchivaTaskScheduler repositoryTaskScheduler; @Inject @@ -162,13 +161,13 @@ public class DefaultManagedRepositoryAdmin for ( ManagedRepositoryConfiguration repoConfig : managedRepoConfigs ) { - // TODO add staging repo information back too ManagedRepository repo = new ManagedRepository( repoConfig.getId(), repoConfig.getName(), repoConfig.getLocation(), repoConfig.getLayout(), repoConfig.isSnapshots(), repoConfig.isReleases(), repoConfig.isBlockRedeployments(), repoConfig.getRefreshCronExpression(), repoConfig.getIndexDir(), repoConfig.isScanned(), repoConfig.getDaysOlder(), - repoConfig.getRetentionCount(), repoConfig.isDeleteReleasedSnapshots(), false ); + repoConfig.getRetentionCount(), repoConfig.isDeleteReleasedSnapshots(), + repoConfig.isStageRepoNeeded() ); repo.setDescription( repoConfig.getDescription() ); repo.setSkipPackedIndexCreation( repoConfig.isSkipPackedIndexCreation() ); managedRepos.add( repo ); @@ -257,6 +256,7 @@ public class DefaultManagedRepositoryAdmin repository.setIndexDir( indexDir ); repository.setDescription( description ); repository.setSkipPackedIndexCreation( skipPackedIndexCreation ); + repository.setStageRepoNeeded( stageRepoNeeded ); try { -- 2.39.5