archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sk...@apache.org
Subject svn commit: r1379186 - /archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java
Date Thu, 30 Aug 2012 22:09:52 GMT
Author: skygo
Date: Thu Aug 30 22:09:52 2012
New Revision: 1379186

URL: http://svn.apache.org/viewvc?rev=1379186&view=rev
Log:
further fix to  MRM1658

Modified:
    archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java

Modified: archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java?rev=1379186&r1=1379185&r2=1379186&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java
(original)
+++ archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java
Thu Aug 30 22:09:52 2012
@@ -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 );



Mime
View raw message