diff options
author | Olivier Lamy <olamy@apache.org> | 2012-06-19 22:56:42 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2012-06-19 22:56:42 +0000 |
commit | c68f1c31540d02be6362c21d92167f5ef9b9a023 (patch) | |
tree | 8771aaa12a971c2f393034322e1d6aa523ee8aed /archiva-modules | |
parent | 74077123a73e274c071b8cf0f4e1c2e1967efa4f (diff) | |
download | archiva-c68f1c31540d02be6362c21d92167f5ef9b9a023.tar.gz archiva-c68f1c31540d02be6362c21d92167f5ef9b9a023.zip |
correctly update metadata after deletion
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1351896 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-rw-r--r-- | archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java | 19 |
1 files 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<ArtifactReference> 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<ArtifactReference> related = repository.getRelatedArtifacts( artifactReference ); - log.debug( "related: {}", related ); - for ( ArtifactReference artifactRef : related ) - { - repository.deleteArtifact( artifactRef ); - } - } - for ( ArtifactMetadata artifactMetadata : artifacts ) { |