]> source.dussan.org Git - archiva.git/commitdiff
correctly update metadata after deletion
authorOlivier Lamy <olamy@apache.org>
Tue, 19 Jun 2012 22:56:42 +0000 (22:56 +0000)
committerOlivier Lamy <olamy@apache.org>
Tue, 19 Jun 2012 22:56:42 +0000 (22:56 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1351896 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoriesService.java

index d39d8c5d85cdd954cc4e4098153b272c49da16e9..e51a360f0e744773fb063997097cee7e95bfec57 100644 (file)
@@ -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 )
             {