correctly update metadata after deletion

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1351896 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-06-19 22:56:42 +00:00
parent 74077123a7
commit c68f1c3154
1 changed files with 9 additions and 10 deletions

View 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 )
{