]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1846] Regression in 2.0.1 : uniqueVersion false not supported
authorOlivier Lamy <olamy@apache.org>
Mon, 15 Sep 2014 04:54:08 +0000 (14:54 +1000)
committerOlivier Lamy <olamy@apache.org>
Mon, 15 Sep 2014 04:54:08 +0000 (14:54 +1000)
archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java
archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java

index 375c4d83dfe57705fa797186a32983ae748686aa..1e225a60a25367596c2626eb6140ff7703bdb35b 100644 (file)
@@ -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 )
index 1f6cd2b712cee022782ce439f4fc0d4b0fb04ec6..44d29474223442391d72b7c2601e0371bdd187de 100644 (file)
@@ -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.
  * <p/>
  */
-@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