You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2010/09/10 00:52:58 UTC

svn commit: r995600 - in /maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven: DefaultMaven.java execution/DefaultMavenExecutionRequest.java execution/MavenExecutionRequest.java

Author: bentmann
Date: Thu Sep  9 22:52:57 2010
New Revision: 995600

URL: http://svn.apache.org/viewvc?rev=995600&view=rev
Log:
[MNG-4343] maven always checks missing release artifacts
[MNG-4592] Snapshot artifacts that could not be downloaded due to communication problems are "blacklisted" for a day by default.

o Allowed to configure caching of resolution errors in the execution request, thereby providing better control for CLI and IDE to select the desired behavior

Modified:
    maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
    maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java
    maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java

Modified: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/DefaultMaven.java?rev=995600&r1=995599&r2=995600&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/DefaultMaven.java (original)
+++ maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/DefaultMaven.java Thu Sep  9 22:52:57 2010
@@ -345,8 +345,8 @@ public class DefaultMaven
         session.setChecksumPolicy( request.getGlobalChecksumPolicy() );
         session.setUpdatePolicy( request.isUpdateSnapshots() ? RepositoryPolicy.UPDATE_POLICY_ALWAYS : null );
 
-        session.setNotFoundCachingEnabled( !request.isUpdateSnapshots() );
-        session.setTransferErrorCachingEnabled( !request.isUpdateSnapshots() );
+        session.setNotFoundCachingEnabled( request.isCacheNotFound() );
+        session.setTransferErrorCachingEnabled( request.isCacheTransferError() );
 
         session.setArtifactTypeRegistry( RepositoryUtils.newArtifactTypeRegistry( artifactHandlerManager ) );
 

Modified: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java?rev=995600&r1=995599&r2=995600&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java (original)
+++ maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequest.java Thu Sep  9 22:52:57 2010
@@ -56,6 +56,10 @@ public class DefaultMavenExecutionReques
 
     private boolean interactiveMode = true;
 
+    private boolean cacheTransferError = true;
+
+    private boolean cacheNotFound = true;
+
     private List<Proxy> proxies;
 
     private List<Server> servers;
@@ -150,6 +154,8 @@ public class DefaultMavenExecutionReques
         copy.setLocalRepositoryPath( original.getLocalRepositoryPath() );
         copy.setOffline( original.isOffline() );
         copy.setInteractiveMode( original.isInteractiveMode() );
+        copy.setCacheNotFound( original.isCacheNotFound() );
+        copy.setCacheTransferError( original.isCacheTransferError() );
         copy.setProxies( original.getProxies() );
         copy.setServers( original.getServers() );
         copy.setMirrors( original.getMirrors() );
@@ -1048,4 +1054,26 @@ public class DefaultMavenExecutionReques
         return this;
     }
 
+    public boolean isCacheTransferError()
+    {
+        return cacheTransferError;
+    }
+
+    public MavenExecutionRequest setCacheTransferError( boolean cacheTransferError )
+    {
+        this.cacheTransferError = cacheTransferError;
+        return this;
+    }
+
+    public boolean isCacheNotFound()
+    {
+        return cacheNotFound;
+    }
+
+    public MavenExecutionRequest setCacheNotFound( boolean cacheNotFound )
+    {
+        this.cacheNotFound = cacheNotFound;
+        return this;
+    }
+
 }

Modified: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java?rev=995600&r1=995599&r2=995600&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java (original)
+++ maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/execution/MavenExecutionRequest.java Thu Sep  9 22:52:57 2010
@@ -204,6 +204,12 @@ public interface MavenExecutionRequest
     MavenExecutionRequest setOffline( boolean offline );
     boolean isOffline();
 
+    boolean isCacheTransferError();
+    MavenExecutionRequest setCacheTransferError( boolean cacheTransferError );
+
+    boolean isCacheNotFound();
+    MavenExecutionRequest setCacheNotFound( boolean cacheNotFound );
+
     // Profiles
     List<Profile> getProfiles();
     MavenExecutionRequest addProfile( Profile profile );