diff options
author | Brett Porter <brett@apache.org> | 2009-12-23 01:01:32 +0000 |
---|---|---|
committer | Brett Porter <brett@apache.org> | 2009-12-23 01:01:32 +0000 |
commit | 4ad4cd3cedf251ea5f6d979aec4fad89022cef24 (patch) | |
tree | db798d25b34a21d6b250fad36ca785ff70594f2e /archiva-modules/archiva-base | |
parent | b85d4d795b988693dafe91b10e4d418822538308 (diff) | |
download | archiva-4ad4cd3cedf251ea5f6d979aec4fad89022cef24.tar.gz archiva-4ad4cd3cedf251ea5f6d979aec4fad89022cef24.zip |
[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
Diffstat (limited to 'archiva-modules/archiva-base')
-rw-r--r-- | archiva-modules/archiva-base/archiva-consumers/archiva-metadata-consumer/src/main/java/org/apache/archiva/consumers/metadata/ArchivaMetadataCreationConsumer.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-metadata-consumer/src/main/java/org/apache/archiva/consumers/metadata/ArchivaMetadataCreationConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-metadata-consumer/src/main/java/org/apache/archiva/consumers/metadata/ArchivaMetadataCreationConsumer.java index bd062ccae..9ca98285e 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-metadata-consumer/src/main/java/org/apache/archiva/consumers/metadata/ArchivaMetadataCreationConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-metadata-consumer/src/main/java/org/apache/archiva/consumers/metadata/ArchivaMetadataCreationConsumer.java @@ -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 ); } |