From c3ef4bfbfb5ee04e5e2b48135916a50af64d4932 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Mon, 15 Sep 2014 14:54:08 +1000 Subject: [PATCH] =?utf8?q?[MRM-1846]=C2=A0Regression=20in=202.0.1=20:=20un?= =?utf8?q?iqueVersion=20false=20not=20supported?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../archiva/webdav/ArchivaDavResourceFactory.java | 7 ++++--- .../storage/maven2/Maven2RepositoryStorage.java | 14 ++++++++++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java index 375c4d83d..1e225a60a 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java @@ -557,8 +557,9 @@ public class ArchivaDavResourceFactory return path; } - private String evaluatePathWithVersion( ArchivaDavResourceLocator archivaLocator, - ManagedRepositoryContent managedRepositoryContent, String contextPath ) + private String evaluatePathWithVersion( ArchivaDavResourceLocator archivaLocator, // + ManagedRepositoryContent managedRepositoryContent, // + String contextPath ) throws DavException { String layout = managedRepositoryContent.getRepository() == null @@ -568,7 +569,7 @@ public class ArchivaDavResourceFactory this.applicationContext.getBean( "repositoryStorage#" + layout, RepositoryStorage.class ); try { - return repositoryStorage.getFilePathWithVersion( archivaLocator.getResourcePath(), + return repositoryStorage.getFilePathWithVersion( archivaLocator.getResourcePath(), // managedRepositoryContent ); } catch ( RelocationException e ) diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java index 1f6cd2b71..44d294742 100644 --- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java +++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java @@ -35,6 +35,7 @@ import org.apache.archiva.maven2.metadata.MavenMetadataReader; import org.apache.archiva.metadata.model.ArtifactMetadata; import org.apache.archiva.metadata.model.ProjectMetadata; import org.apache.archiva.metadata.model.ProjectVersionMetadata; +import org.apache.archiva.metadata.model.facets.RepositoryProblemFacet; import org.apache.archiva.metadata.repository.filter.Filter; import org.apache.archiva.metadata.repository.storage.ReadMetadataRequest; import org.apache.archiva.metadata.repository.storage.RelocationException; @@ -49,7 +50,6 @@ import org.apache.archiva.model.SnapshotVersion; import org.apache.archiva.policies.ProxyDownloadException; import org.apache.archiva.proxy.common.WagonFactory; import org.apache.archiva.proxy.model.RepositoryProxyConnectors; -import org.apache.archiva.metadata.model.facets.RepositoryProblemFacet; import org.apache.archiva.repository.ManagedRepositoryContent; import org.apache.archiva.repository.content.PathParser; import org.apache.archiva.repository.layout.LayoutException; @@ -107,7 +107,7 @@ import java.util.Map; * within the session in the context of a single managed repository's resolution needs. *

*/ -@Service("repositoryStorage#maven2") +@Service( "repositoryStorage#maven2" ) public class Maven2RepositoryStorage implements RepositoryStorage { @@ -129,7 +129,7 @@ public class Maven2RepositoryStorage private NetworkProxyAdmin networkProxyAdmin; @Inject - @Named("repositoryPathTranslator#maven2") + @Named( "repositoryPathTranslator#maven2" ) private RepositoryPathTranslator pathTranslator; @Inject @@ -139,7 +139,7 @@ public class Maven2RepositoryStorage private ApplicationContext applicationContext; @Inject - @Named("pathParser#default") + @Named( "pathParser#default" ) private PathParser pathParser; private static final String METADATA_FILENAME_START = "maven-metadata"; @@ -805,6 +805,12 @@ public class Maven2RepositoryStorage int buildNumber = archivaRepositoryMetadata.getSnapshotVersion().getBuildNumber(); String timestamp = archivaRepositoryMetadata.getSnapshotVersion().getTimestamp(); + // MRM-1846 + if ( buildNumber < 1 && timestamp == null ) + { + return filePath; + } + // org/apache/archiva/archiva-checksum/1.4-M4-SNAPSHOT/archiva-checksum-1.4-M4-SNAPSHOT.jar // -> archiva-checksum-1.4-M4-20130425.081822-1.jar -- 2.39.5