maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From micha...@apache.org
Subject maven git commit: [MNG-5935] Optional true getting lost in managed dependencies when transitive
Date Sat, 06 May 2017 23:35:37 GMT
Repository: maven
Updated Branches:
  refs/heads/MNG-5935 [created] c40674c64


[MNG-5935] Optional true getting lost in managed dependencies when transitive

Updated to correctly map the optional flag of Maven model dependencies to
Aether dependencies. Prior to this change all managed dependencies implicitly
had the optional flag set to 'false' leading to Aether managing that flag to
'false' on all managed dependencies when transitive.


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

Branch: refs/heads/MNG-5935
Commit: c40674c646ca4fe73d7dc177ba820022a7eb07dc
Parents: f7d4bce
Author: Christian Schulte <schulte@apache.org>
Authored: Thu Feb 11 08:45:19 2016 +0100
Committer: Michael Osipov <michaelo@apache.org>
Committed: Wed May 3 17:54:58 2017 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/maven/RepositoryUtils.java       | 7 ++++++-
 .../repository/internal/ArtifactDescriptorReaderDelegate.java | 6 +++++-
 2 files changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/c40674c6/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java
----------------------------------------------------------------------
diff --git a/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java b/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java
index 86eab4e..52442b7 100644
--- a/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java
+++ b/maven-core/src/main/java/org/apache/maven/RepositoryUtils.java
@@ -316,7 +316,12 @@ public class RepositoryUtils
             exclusions.add( toExclusion( exclusion ) );
         }
 
-        Dependency result = new Dependency( artifact, dependency.getScope(), dependency.isOptional(),
exclusions );
+        Dependency result = new Dependency( artifact,
+                                            dependency.getScope(),
+                                            dependency.getOptional() != null
+                                                ? dependency.isOptional()
+                                                : null,
+                                            exclusions );
 
         return result;
     }

http://git-wip-us.apache.org/repos/asf/maven/blob/c40674c6/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorReaderDelegate.java
----------------------------------------------------------------------
diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorReaderDelegate.java
b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorReaderDelegate.java
index 42060b4..8219205 100644
--- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorReaderDelegate.java
+++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/ArtifactDescriptorReaderDelegate.java
@@ -124,7 +124,11 @@ public class ArtifactDescriptorReaderDelegate
             exclusions.add( convert( exclusion ) );
         }
 
-        Dependency result = new Dependency( artifact, dependency.getScope(), dependency.isOptional(),
exclusions );
+        Dependency result = new Dependency( artifact, dependency.getScope(),
+                                            dependency.getOptional() != null
+                                                ? dependency.isOptional()
+                                                : null,
+                                            exclusions );
 
         return result;
     }


Mime
View raw message