[MRM-1846] Regression in 2.0.1 : uniqueVersion false not supported

This commit is contained in:
Olivier Lamy 2014-09-15 14:54:08 +10:00
parent 6ad62d943a
commit c3ef4bfbfb
2 changed files with 14 additions and 7 deletions

View File

@ -557,8 +557,9 @@ public class ArchivaDavResourceFactory
return path; return path;
} }
private String evaluatePathWithVersion( ArchivaDavResourceLocator archivaLocator, private String evaluatePathWithVersion( ArchivaDavResourceLocator archivaLocator, //
ManagedRepositoryContent managedRepositoryContent, String contextPath ) ManagedRepositoryContent managedRepositoryContent, //
String contextPath )
throws DavException throws DavException
{ {
String layout = managedRepositoryContent.getRepository() == null String layout = managedRepositoryContent.getRepository() == null
@ -568,7 +569,7 @@ public class ArchivaDavResourceFactory
this.applicationContext.getBean( "repositoryStorage#" + layout, RepositoryStorage.class ); this.applicationContext.getBean( "repositoryStorage#" + layout, RepositoryStorage.class );
try try
{ {
return repositoryStorage.getFilePathWithVersion( archivaLocator.getResourcePath(), return repositoryStorage.getFilePathWithVersion( archivaLocator.getResourcePath(), //
managedRepositoryContent ); managedRepositoryContent );
} }
catch ( RelocationException e ) catch ( RelocationException e )

View 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.ArtifactMetadata;
import org.apache.archiva.metadata.model.ProjectMetadata; import org.apache.archiva.metadata.model.ProjectMetadata;
import org.apache.archiva.metadata.model.ProjectVersionMetadata; 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.filter.Filter;
import org.apache.archiva.metadata.repository.storage.ReadMetadataRequest; import org.apache.archiva.metadata.repository.storage.ReadMetadataRequest;
import org.apache.archiva.metadata.repository.storage.RelocationException; 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.policies.ProxyDownloadException;
import org.apache.archiva.proxy.common.WagonFactory; import org.apache.archiva.proxy.common.WagonFactory;
import org.apache.archiva.proxy.model.RepositoryProxyConnectors; 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.ManagedRepositoryContent;
import org.apache.archiva.repository.content.PathParser; import org.apache.archiva.repository.content.PathParser;
import org.apache.archiva.repository.layout.LayoutException; 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. * within the session in the context of a single managed repository's resolution needs.
* <p/> * <p/>
*/ */
@Service("repositoryStorage#maven2") @Service( "repositoryStorage#maven2" )
public class Maven2RepositoryStorage public class Maven2RepositoryStorage
implements RepositoryStorage implements RepositoryStorage
{ {
@ -129,7 +129,7 @@ public class Maven2RepositoryStorage
private NetworkProxyAdmin networkProxyAdmin; private NetworkProxyAdmin networkProxyAdmin;
@Inject @Inject
@Named("repositoryPathTranslator#maven2") @Named( "repositoryPathTranslator#maven2" )
private RepositoryPathTranslator pathTranslator; private RepositoryPathTranslator pathTranslator;
@Inject @Inject
@ -139,7 +139,7 @@ public class Maven2RepositoryStorage
private ApplicationContext applicationContext; private ApplicationContext applicationContext;
@Inject @Inject
@Named("pathParser#default") @Named( "pathParser#default" )
private PathParser pathParser; private PathParser pathParser;
private static final String METADATA_FILENAME_START = "maven-metadata"; private static final String METADATA_FILENAME_START = "maven-metadata";
@ -805,6 +805,12 @@ public class Maven2RepositoryStorage
int buildNumber = archivaRepositoryMetadata.getSnapshotVersion().getBuildNumber(); int buildNumber = archivaRepositoryMetadata.getSnapshotVersion().getBuildNumber();
String timestamp = archivaRepositoryMetadata.getSnapshotVersion().getTimestamp(); 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 // 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 // -> archiva-checksum-1.4-M4-20130425.081822-1.jar