aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2014-09-15 14:54:08 +1000
committerOlivier Lamy <olamy@apache.org>2014-09-15 14:54:08 +1000
commitc3ef4bfbfb5ee04e5e2b48135916a50af64d4932 (patch)
tree2592a0feebc547f2c28679735799cbcaff2f66b5
parent6ad62d943a12127e9c6275889d61c80041251906 (diff)
downloadarchiva-c3ef4bfbfb5ee04e5e2b48135916a50af64d4932.tar.gz
archiva-c3ef4bfbfb5ee04e5e2b48135916a50af64d4932.zip
[MRM-1846] Regression in 2.0.1 : uniqueVersion false not supported
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java7
-rw-r--r--archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java14
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.
* <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