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(),
|
storageResolver.getProjectVersion( repository.getId(), artifact.getGroupId(), artifact.getArtifactId(),
|
||||||
projectVersion );
|
projectVersion );
|
||||||
|
|
||||||
|
boolean createVersionMetadata = false;
|
||||||
if ( versionMetadata == null )
|
if ( versionMetadata == null )
|
||||||
{
|
{
|
||||||
log.warn( "Missing POM for artifact: " + path + "; creating empty metadata" );
|
log.warn( "Missing POM for artifact: " + path + "; creating empty metadata" );
|
||||||
versionMetadata = new ProjectVersionMetadata();
|
versionMetadata = new ProjectVersionMetadata();
|
||||||
versionMetadata.setId( projectVersion );
|
versionMetadata.setId( projectVersion );
|
||||||
|
createVersionMetadata = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ArtifactMetadata artifactMeta = new ArtifactMetadata();
|
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
|
// read the metadata and update it if it is newer or doesn't exist
|
||||||
metadataRepository.updateArtifact( repository.getId(), project.getNamespace(), project.getId(), projectVersion,
|
metadataRepository.updateArtifact( repository.getId(), project.getNamespace(), project.getId(), projectVersion,
|
||||||
artifactMeta );
|
artifactMeta );
|
||||||
metadataRepository.updateProjectVersion( repository.getId(), project.getNamespace(), project.getId(),
|
if ( createVersionMetadata )
|
||||||
versionMetadata );
|
{
|
||||||
|
metadataRepository.updateProjectVersion( repository.getId(), project.getNamespace(), project.getId(),
|
||||||
|
versionMetadata );
|
||||||
|
}
|
||||||
metadataRepository.updateProject( repository.getId(), project );
|
metadataRepository.updateProject( repository.getId(), project );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue