mirror of https://github.com/apache/archiva.git
[MRM-1282] only create version metadata if necessary
git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/MRM-1025@893368 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b85d4d795b
commit
4ad4cd3ced
|
@ -166,11 +166,13 @@ public class ArchivaMetadataCreationConsumer
|
|||
storageResolver.getProjectVersion( repository.getId(), artifact.getGroupId(), artifact.getArtifactId(),
|
||||
projectVersion );
|
||||
|
||||
boolean createVersionMetadata = false;
|
||||
if ( versionMetadata == null )
|
||||
{
|
||||
log.warn( "Missing POM for artifact: " + path + "; creating empty metadata" );
|
||||
versionMetadata = new ProjectVersionMetadata();
|
||||
versionMetadata.setId( projectVersion );
|
||||
createVersionMetadata = true;
|
||||
}
|
||||
|
||||
ArtifactMetadata artifactMeta = new ArtifactMetadata();
|
||||
|
@ -205,8 +207,11 @@ public class ArchivaMetadataCreationConsumer
|
|||
// read the metadata and update it if it is newer or doesn't exist
|
||||
metadataRepository.updateArtifact( repository.getId(), project.getNamespace(), project.getId(), projectVersion,
|
||||
artifactMeta );
|
||||
metadataRepository.updateProjectVersion( repository.getId(), project.getNamespace(), project.getId(),
|
||||
versionMetadata );
|
||||
if ( createVersionMetadata )
|
||||
{
|
||||
metadataRepository.updateProjectVersion( repository.getId(), project.getNamespace(), project.getId(),
|
||||
versionMetadata );
|
||||
}
|
||||
metadataRepository.updateProject( repository.getId(), project );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue