From c68f1c31540d02be6362c21d92167f5ef9b9a023 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Tue, 19 Jun 2012 22:56:42 +0000 Subject: [PATCH] correctly update metadata after deletion git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1351896 13f79535-47bb-0310-9956-ffa450edef68 --- .../services/DefaultRepositoriesService.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java index d39d8c5d8..e51a360f0 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java @@ -714,6 +714,15 @@ public class DefaultRepositoriesService { repository.deleteVersion( ref ); } + else + { + Set related = repository.getRelatedArtifacts( artifactReference ); + log.debug( "related: {}", related ); + for ( ArtifactReference artifactRef : related ) + { + repository.deleteArtifact( artifactRef ); + } + } File metadataFile = getMetadata( targetPath.getAbsolutePath() ); ArchivaRepositoryMetadata metadata = getMetadata( metadataFile ); @@ -723,16 +732,6 @@ public class DefaultRepositoriesService metadataRepository.getArtifacts( repositoryId, artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion() ); - if ( snapshotVersion ) - { - Set related = repository.getRelatedArtifacts( artifactReference ); - log.debug( "related: {}", related ); - for ( ArtifactReference artifactRef : related ) - { - repository.deleteArtifact( artifactRef ); - } - } - for ( ArtifactMetadata artifactMetadata : artifacts ) { -- 2.39.5