diff options
author | skygo <skygo@unknown> | 2012-08-30 22:09:52 +0000 |
---|---|---|
committer | skygo <skygo@unknown> | 2012-08-30 22:09:52 +0000 |
commit | ba0ab8c0212e2113291abe2fd58947eb7a42c5f5 (patch) | |
tree | 2a50b2744c77c7718ab257ba0e6c159a1208ee42 | |
parent | 53a0d9255db7cd6b8c9cff1613f589f85d4366c3 (diff) | |
download | archiva-ba0ab8c0212e2113291abe2fd58947eb7a42c5f5.tar.gz archiva-ba0ab8c0212e2113291abe2fd58947eb7a42c5f5.zip |
further fix to MRM1658
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1379186 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java index 92fe5a097..6895cffbe 100644 --- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java +++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java @@ -54,6 +54,7 @@ import java.io.File; import java.io.IOException; import java.util.List; import java.util.Map; +import org.apache.archiva.metadata.repository.storage.RepositoryStorageRuntimeException; public class RepositoryModelResolver implements ModelResolver @@ -90,6 +91,8 @@ public class RepositoryModelResolver { this( new File( managedRepository.getLocation() ), pathTranslator ); + this.managedRepository = managedRepository; + this.wagonFactory = wagonFactory; this.remoteRepositories = remoteRepositories; @@ -109,7 +112,20 @@ public class RepositoryModelResolver if ( !model.exists() ) { - + if ( VersionUtil.isSnapshot( version ) ) // skygo trying to improve speed by honoring managed configuration MRM-1658 + { + if ( managedRepository.isReleases() && !managedRepository.isSnapshots() ) + { + throw new UnresolvableModelException("lookforsnaponreleaseonly", groupId, artifactId, version ); + } + } + else + { + if ( !managedRepository.isReleases() && managedRepository.isSnapshots() ) + { + throw new UnresolvableModelException("lookforsreleaseonsneponly", groupId, artifactId, version ); + } + } // is a SNAPSHOT ? so we can try to find locally before asking remote repositories. if ( StringUtils.contains( version, VersionUtil.SNAPSHOT ) ) { @@ -231,6 +247,7 @@ public class RepositoryModelResolver String protocol = getProtocol( remoteRepository.getUrl() ); final NetworkProxy networkProxy = this.networkProxyMap.get( remoteRepository.getId() ); + // XXX skygo: look strange to me wagon = ( networkProxy != null && networkProxy.isUseNtlm() ) ? wagonFactory.getWagon( "wagon#" + protocol + "-ntlm" ) : wagonFactory.getWagon( "wagon#" + protocol ); wagon = wagonFactory.getWagon( "wagon#" + protocol ); |