diff options
author | Olivier Lamy <olamy@apache.org> | 2012-06-22 13:10:41 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2012-06-22 13:10:41 +0000 |
commit | 69ff5ca81c8bf5833d5c841dbe1437ad23688370 (patch) | |
tree | dc52044bafb2841714835a27c72dc6434df25d6f | |
parent | bb1775cd72418294ca9e63c8a861185618046a2a (diff) | |
download | archiva-69ff5ca81c8bf5833d5c841dbe1437ad23688370.tar.gz archiva-69ff5ca81c8bf5833d5c841dbe1437ad23688370.zip |
take of version when we delete a timestamped snapshot
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1352873 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java | 21 |
1 files changed, 18 insertions, 3 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 e51a360f0..e69ce4631 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 @@ -728,9 +728,23 @@ public class DefaultRepositoriesService updateMetadata( metadata, metadataFile, lastUpdatedTimestamp, artifact ); } - Collection<ArtifactMetadata> artifacts = - metadataRepository.getArtifacts( repositoryId, artifact.getGroupId(), artifact.getArtifactId(), - artifact.getVersion() ); + Collection<ArtifactMetadata> artifacts = Collections.emptyList(); + + if ( snapshotVersion ) + { + String baseVersion = VersionUtil.getBaseVersion( artifact.getVersion() ); + artifacts = + metadataRepository.getArtifacts( repositoryId, artifact.getGroupId(), artifact.getArtifactId(), + baseVersion ); + } + else + { + artifacts = + metadataRepository.getArtifacts( repositoryId, artifact.getGroupId(), artifact.getArtifactId(), + artifact.getVersion() ); + } + + log.debug( "artifacts: {}", artifacts ); for ( ArtifactMetadata artifactMetadata : artifacts ) { @@ -813,6 +827,7 @@ public class DefaultRepositoriesService } finally { + repositorySession.save(); repositorySession.close(); |