maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r945715 - in /maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven: artifact/resolver/DefaultArtifactResolver.java repository/legacy/resolver/DefaultLegacyArtifactCollector.java
Date Tue, 18 May 2010 15:49:14 GMT
Author: bentmann
Date: Tue May 18 15:49:14 2010
New Revision: 945715

URL: http://svn.apache.org/viewvc?rev=945715&view=rev
Log:
[MNG-4679] [regression] command line option "-update-snapshots" does not work for dependency:copy-dependencies

Modified:
    maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java
    maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/repository/legacy/resolver/DefaultLegacyArtifactCollector.java

Modified: maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java?rev=945715&r1=945714&r2=945715&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java
(original)
+++ maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java
Tue May 18 15:49:14 2010
@@ -135,28 +135,25 @@ public class DefaultArtifactResolver
         }
     }
 
-    private void injectSession( RepositoryRequest request )
+    private void injectSession1( RepositoryRequest request, MavenSession session )
     {
-        MavenSession session = legacySupport.getSession();
-
         if ( session != null )
         {
             request.setOffline( session.isOffline() );
+            request.setForceUpdate( session.getRequest().isUpdateSnapshots() );
             request.setTransferListener( session.getRequest().getTransferListener() );
         }
     }
 
-    private void injectSession( ArtifactResolutionRequest request )
+    private void injectSession2( ArtifactResolutionRequest request, MavenSession session
)
     {
-        MavenSession session = legacySupport.getSession();
+        injectSession1( request, session );
 
         if ( session != null )
         {
-            request.setOffline( session.isOffline() );
             request.setServers( session.getRequest().getServers() );
             request.setMirrors( session.getRequest().getMirrors() );
             request.setProxies( session.getRequest().getProxies() );
-            request.setTransferListener( session.getRequest().getTransferListener() );
         }
     }
 
@@ -164,7 +161,7 @@ public class DefaultArtifactResolver
         throws ArtifactResolutionException, ArtifactNotFoundException
     {
         RepositoryRequest request = new DefaultRepositoryRequest();
-        injectSession( request );
+        injectSession1( request, legacySupport.getSession() );
         request.setLocalRepository( localRepository );
         request.setRemoteRepositories( remoteRepositories );
         resolve( artifact, request, resolutionListener, false );
@@ -174,7 +171,7 @@ public class DefaultArtifactResolver
         throws ArtifactResolutionException, ArtifactNotFoundException
     {
         RepositoryRequest request = new DefaultRepositoryRequest();
-        injectSession( request );
+        injectSession1( request, legacySupport.getSession() );
         request.setLocalRepository( localRepository );
         request.setRemoteRepositories( remoteRepositories );
         resolve( artifact, request, null, true );
@@ -435,7 +432,7 @@ public class DefaultArtifactResolver
             .setCollectionFilter( filter )
             .setListeners( listeners );
 
-        injectSession( request );
+        injectSession2( request, legacySupport.getSession() );
 
         return resolveWithExceptions( request );
     }

Modified: maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/repository/legacy/resolver/DefaultLegacyArtifactCollector.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/repository/legacy/resolver/DefaultLegacyArtifactCollector.java?rev=945715&r1=945714&r2=945715&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/repository/legacy/resolver/DefaultLegacyArtifactCollector.java
(original)
+++ maven/maven-3/trunk/maven-compat/src/main/java/org/apache/maven/repository/legacy/resolver/DefaultLegacyArtifactCollector.java
Tue May 18 15:49:14 2010
@@ -79,6 +79,7 @@ public class DefaultLegacyArtifactCollec
         if ( session != null )
         {
             request.setOffline( session.isOffline() );
+            request.setForceUpdate( session.getRequest().isUpdateSnapshots() );
             request.setServers( session.getRequest().getServers() );
             request.setMirrors( session.getRequest().getMirrors() );
             request.setProxies( session.getRequest().getProxies() );



Mime
View raw message