maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From schu...@apache.org
Subject [07/16] maven git commit: [MNG-4347] import-scoped dependencies of direct dependencies are not resolved using profile modifications from settings.xml
Date Sat, 04 Feb 2017 23:11:49 GMT
[MNG-4347] import-scoped dependencies of direct dependencies are not resolved using profile
modifications from settings.xml

o Updated the 'DefaultModelResolver' to handle replacing repositories the same way the
  'DefaultDependencyCollector' does. When the 'DefaultDependencyCollector' finds
  a repository in a child node with an id matching a repository already in use,
  it will only merge any mirror definitions but never change the repository already
  in use. The 'DefaultModelResolver' needs to follow the same logic. What has been
  provided must not change for consistency.


Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/9f4a3653
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/9f4a3653
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/9f4a3653

Branch: refs/heads/DEPMGMT-IT
Commit: 9f4a3653eae96afafc6e89be9240e877489006c6
Parents: 743be82
Author: Christian Schulte <schulte@apache.org>
Authored: Tue Dec 13 03:30:32 2016 +0100
Committer: Christian Schulte <schulte@apache.org>
Committed: Sun Feb 5 00:06:15 2017 +0100

----------------------------------------------------------------------
 .../maven/repository/internal/DefaultModelResolver.java | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/9f4a3653/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java
----------------------------------------------------------------------
diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java
b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java
index 260a770..0cc5b17 100644
--- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java
+++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java
@@ -71,6 +71,8 @@ class DefaultModelResolver
 
     private final List<RemoteRepository> externalRepositories;
 
+    private final Set<String> externalRepositoryIds;
+
     private final ArtifactResolver resolver;
 
     private final VersionRangeResolver versionRangeResolver;
@@ -93,8 +95,13 @@ class DefaultModelResolver
         List<RemoteRepository> externalRepositories = new ArrayList<>();
         externalRepositories.addAll( repositories );
         this.externalRepositories = Collections.unmodifiableList( externalRepositories );
-
         this.repositoryIds = new HashSet<>();
+        this.externalRepositoryIds = new HashSet<>();
+        for ( final RemoteRepository repository : this.repositories )
+        {
+            this.repositoryIds.add( repository.getId() );
+            this.externalRepositoryIds.add( repository.getId() );
+        }
     }
 
     private DefaultModelResolver( DefaultModelResolver original )
@@ -108,6 +115,7 @@ class DefaultModelResolver
         this.repositories = new ArrayList<>( original.repositories );
         this.externalRepositories = original.externalRepositories;
         this.repositoryIds = new HashSet<>( original.repositoryIds );
+        this.externalRepositoryIds = new HashSet<>( original.externalRepositoryIds
);
     }
 
     @Override
@@ -128,7 +136,7 @@ class DefaultModelResolver
 
         if ( !repositoryIds.add( repository.getId() ) )
         {
-            if ( !replace )
+            if ( !replace || this.externalRepositoryIds.contains( repository.getId() ) )
             {
                 return;
             }


Mime
View raw message