maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From schu...@apache.org
Subject [09/18] maven git commit: [MNG-5639] Support resolution of Import Scope POMs from Repo that contains a ${parameter}
Date Sun, 12 Feb 2017 13:54:34 GMT
[MNG-5639] Support resolution of Import Scope POMs from Repo that contains a ${parameter}

o Updated to stop replacing external repositories when repository merging is set
  to REQUEST_DOMINANT.


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

Branch: refs/heads/DEPMGMT-IT
Commit: 5d35840ac560ba84ceb555ee56c01a25f017f1b5
Parents: d567cfe
Author: Christian Schulte <schulte@apache.org>
Authored: Tue Dec 13 20:16:20 2016 +0100
Committer: Christian Schulte <schulte@apache.org>
Committed: Sun Feb 12 14:51:27 2017 +0100

----------------------------------------------------------------------
 .../project/DefaultProjectBuildingRequest.java   | 19 +++++++++++--------
 .../maven/project/ProjectModelResolver.java      | 12 +++++++++++-
 2 files changed, 22 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/5d35840a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java
----------------------------------------------------------------------
diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java
b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java
index dafbefd..d42da04 100644
--- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java
+++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java
@@ -80,22 +80,25 @@ public class DefaultProjectBuildingRequest
         pluginArtifactRepositories = new ArrayList<>();
     }
 
+    @SuppressWarnings( "deprecation" )
     public DefaultProjectBuildingRequest( ProjectBuildingRequest request )
     {
         this();
-        setProcessPlugins( request.isProcessPlugins() );
-        setProfiles( request.getProfiles() );
         setActiveProfileIds( request.getActiveProfileIds() );
+        setBuildStartTime( request.getBuildStartTime() );
         setInactiveProfileIds( request.getInactiveProfileIds() );
-        setSystemProperties( request.getSystemProperties() );
-        setUserProperties( request.getUserProperties() );
-        setRemoteRepositories( request.getRemoteRepositories() );
-        setPluginArtifactRepositories( request.getPluginArtifactRepositories() );
-        setRepositorySession( request.getRepositorySession() );
         setLocalRepository( request.getLocalRepository() );
-        setBuildStartTime( request.getBuildStartTime() );
+        setPluginArtifactRepositories( request.getPluginArtifactRepositories() );
+        setProcessPlugins( request.isProcessPlugins() );
+        setProfiles( request.getProfiles() );
         setProject( request.getProject() );
+        setRemoteRepositories( request.getRemoteRepositories() );
+        setRepositoryMerging( request.getRepositoryMerging() );
+        setRepositorySession( request.getRepositorySession() );
         setResolveDependencies( request.isResolveDependencies() );
+        setResolveVersionRanges( request.isResolveVersionRanges() );
+        setSystemProperties( request.getSystemProperties() );
+        setUserProperties( request.getUserProperties() );
         setValidationLevel( request.getValidationLevel() );
     }
 

http://git-wip-us.apache.org/repos/asf/maven/blob/5d35840a/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java
----------------------------------------------------------------------
diff --git a/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java b/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java
index e5aa052..90cb599 100644
--- a/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java
+++ b/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java
@@ -79,6 +79,8 @@ public class ProjectModelResolver
 
     private final Set<String> repositoryIds;
 
+    private final Set<String> externalRepositoryIds;
+
     private final ReactorModelPool modelPool;
 
     private final ProjectBuildingRequest.RepositoryMerging repositoryMerging;
@@ -100,7 +102,13 @@ public class ProjectModelResolver
         this.repositories.addAll( externalRepositories );
         this.repositoryMerging = repositoryMerging;
         this.repositoryIds = new HashSet<>();
+        this.externalRepositoryIds = new HashSet<>();
         this.modelPool = modelPool;
+        for ( final RemoteRepository repository : repositories )
+        {
+            this.repositoryIds.add( repository.getId() );
+            this.externalRepositoryIds.add( repository.getId() );
+        }
     }
 
     private ProjectModelResolver( ProjectModelResolver original )
@@ -114,6 +122,7 @@ public class ProjectModelResolver
         this.repositories = new ArrayList<>( original.repositories );
         this.repositoryMerging = original.repositoryMerging;
         this.repositoryIds = new HashSet<>( original.repositoryIds );
+        this.externalRepositoryIds = new HashSet<>( original.externalRepositoryIds
);
         this.modelPool = original.modelPool;
     }
 
@@ -129,7 +138,8 @@ public class ProjectModelResolver
     {
         if ( !repositoryIds.add( repository.getId() ) )
         {
-            if ( !replace )
+            if ( !replace || ( ProjectBuildingRequest.RepositoryMerging.REQUEST_DOMINANT.equals(
repositoryMerging )
+                               && this.externalRepositoryIds.contains( repository.getId()
) ) )
             {
                 return;
             }


Mime
View raw message