mirror of https://github.com/apache/archiva.git
during ManagedRepository update save only once as it cause some issues on RegistryListener (repo not found at the first save after removing the updated repo)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1170130 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2af805785d
commit
b4959a42f5
|
@ -152,7 +152,8 @@ public class DefaultManagedRepositoryAdmin
|
|||
managedRepository.isReleases(), managedRepository.isSnapshots(), needStageRepo,
|
||||
managedRepository.getCronExpression(), managedRepository.getIndexDirectory(),
|
||||
managedRepository.getDaysOlder(), managedRepository.getRetentionCount(),
|
||||
managedRepository.isDeleteReleasedSnapshots(), auditInformation ) != null;
|
||||
managedRepository.isDeleteReleasedSnapshots(), auditInformation,
|
||||
getArchivaConfiguration().getConfiguration() ) != null;
|
||||
|
||||
}
|
||||
|
||||
|
@ -162,12 +163,11 @@ public class DefaultManagedRepositoryAdmin
|
|||
boolean stageRepoNeeded, String cronExpression,
|
||||
String indexDir, int daysOlder, int retentionCount,
|
||||
boolean deteleReleasedSnapshots,
|
||||
AuditInformation auditInformation )
|
||||
AuditInformation auditInformation,
|
||||
Configuration config )
|
||||
throws RepositoryAdminException
|
||||
{
|
||||
|
||||
Configuration config = getArchivaConfiguration().getConfiguration();
|
||||
|
||||
// FIXME : olamy can be empty to avoid scheduled scan ?
|
||||
if ( StringUtils.isNotBlank( cronExpression ) )
|
||||
{
|
||||
|
@ -349,7 +349,8 @@ public class DefaultManagedRepositoryAdmin
|
|||
for ( String repoGroup : repoGroups )
|
||||
{
|
||||
// copy to prevent UnsupportedOperationException
|
||||
RepositoryGroupConfiguration repositoryGroupConfiguration = config.findRepositoryGroupById( repoGroup );
|
||||
RepositoryGroupConfiguration repositoryGroupConfiguration =
|
||||
config.findRepositoryGroupById( repoGroup );
|
||||
List<String> repos = new ArrayList<String>( repositoryGroupConfiguration.getRepositories() );
|
||||
config.removeRepositoryGroup( repositoryGroupConfiguration );
|
||||
repos.remove( repository.getId() );
|
||||
|
@ -405,18 +406,14 @@ public class DefaultManagedRepositoryAdmin
|
|||
configuration.removeManagedRepository( stagingRepository );
|
||||
}
|
||||
|
||||
if ( toremove != null && stagingRepository != null )
|
||||
{
|
||||
saveConfiguration( configuration );
|
||||
}
|
||||
|
||||
ManagedRepositoryConfiguration managedRepositoryConfiguration =
|
||||
addManagedRepository( managedRepository.getId(), managedRepository.getLayout(), managedRepository.getName(),
|
||||
managedRepository.getLocation(), managedRepository.isBlockRedeployments(),
|
||||
managedRepository.isReleases(), managedRepository.isSnapshots(), needStageRepo,
|
||||
managedRepository.getCronExpression(), managedRepository.getIndexDirectory(),
|
||||
managedRepository.getDaysOlder(), managedRepository.getRetentionCount(),
|
||||
managedRepository.isDeleteReleasedSnapshots(), auditInformation );
|
||||
managedRepository.isDeleteReleasedSnapshots(), auditInformation,
|
||||
getArchivaConfiguration().getConfiguration() );
|
||||
|
||||
// Save the repository configuration.
|
||||
RepositorySession repositorySession = getRepositorySessionFactory().createSession();
|
||||
|
|
Loading…
Reference in New Issue