diff options
author | Martin Stockhammer <martin_s@apache.org> | 2020-06-17 08:55:04 +0200 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2020-06-17 08:55:04 +0200 |
commit | 735a03f2b040a60cd85f5c3cb43257218ab9f26f (patch) | |
tree | bf2bfe7782c9e6931590a0feded6c8b57e33b6ea /archiva-modules/archiva-base/archiva-consumers | |
parent | 1201ef39745d153cd369eb72b80c80a9ecb72553 (diff) | |
download | archiva-735a03f2b040a60cd85f5c3cb43257218ab9f26f.tar.gz archiva-735a03f2b040a60cd85f5c3cb43257218ab9f26f.zip |
API refactoring
Diffstat (limited to 'archiva-modules/archiva-base/archiva-consumers')
-rw-r--r-- | archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/MetadataUpdaterConsumer.java | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/MetadataUpdaterConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/MetadataUpdaterConsumer.java index 5996a06f3..adbec863c 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/MetadataUpdaterConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/MetadataUpdaterConsumer.java @@ -33,6 +33,7 @@ import org.apache.archiva.repository.RepositoryException; import org.apache.archiva.repository.RepositoryNotFoundException; import org.apache.archiva.repository.RepositoryRegistry; import org.apache.archiva.repository.content.Artifact; +import org.apache.archiva.repository.content.ItemSelector; import org.apache.archiva.repository.content.Project; import org.apache.archiva.repository.metadata.RepositoryMetadataException; import org.apache.archiva.repository.metadata.base.MetadataTools; @@ -219,26 +220,22 @@ public class MetadataUpdaterConsumer private void updateVersionMetadata( Artifact artifact, String path ) { - VersionedReference versionRef = new VersionedReference( ); - versionRef.setGroupId( artifact.getNamespace( ).getId() ); - versionRef.setArtifactId( artifact.getId( ) ); - versionRef.setVersion( artifact.getVersion( ).getId() ); try { - String metadataPath = this.metadataTools.toPath( versionRef ); + String metadataPath = this.metadataTools.toPath( artifact.getVersion() ); StorageAsset projectMetadata = this.repositoryDir.resolve( metadataPath ); if ( projectMetadata.exists() && ( projectMetadata.getModificationTime().toEpochMilli() >= this.scanStartTimestamp ) ) { // This metadata is up to date. skip it. - log.debug( "Skipping uptodate metadata: {}", this.metadataTools.toPath( versionRef ) ); + log.debug( "Skipping uptodate metadata: {}", metadataPath ); return; } metadataTools.updateMetadata( this.repository, metadataPath ); - log.debug( "Updated metadata: {}", this.metadataTools.toPath( versionRef ) ); + log.debug( "Updated metadata: {}", metadataPath ); } catch ( RepositoryMetadataException e ) { |