maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From schu...@apache.org
Subject [12/17] maven git commit: [MNG-5227] The 'optional' flag of a dependency should be manageable.
Date Tue, 31 Jan 2017 22:10:02 GMT
[MNG-5227] The 'optional' flag of a dependency should be manageable.


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

Branch: refs/heads/DEPMGMT-IT
Commit: f05b4e00f170dc4f0159abb98ffdab5869786069
Parents: 0b90b27
Author: Christian Schulte <schulte@apache.org>
Authored: Wed Jan 27 03:46:11 2016 +0100
Committer: Christian Schulte <schulte@apache.org>
Committed: Tue Jan 31 23:09:10 2017 +0100

----------------------------------------------------------------------
 .../maven/project/DefaultProjectDependenciesResolver.java    | 8 ++++++++
 .../management/DefaultDependencyManagementInjector.java      | 7 -------
 2 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/f05b4e00/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java
----------------------------------------------------------------------
diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java
b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java
index 50c9e35..7f2f902 100644
--- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java
+++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectDependenciesResolver.java
@@ -273,6 +273,14 @@ public class DefaultProjectDependenciesResolver
                     appendManagementSource( buffer, art, "version" );
                     buffer.append( ")" );
                 }
+
+                Boolean premanagedOptional = DependencyManagerUtils.getPremanagedOptional(
node );
+                if ( premanagedOptional != null && !premanagedOptional.equals( dep.getOptional()
) )
+                {
+                    buffer.append( " (optionality managed from " ).append( premanagedOptional
);
+                    appendManagementSource( buffer, art, "optional" );
+                    buffer.append( ')' );
+                }
             }
             else
             {

http://git-wip-us.apache.org/repos/asf/maven/blob/f05b4e00/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultDependencyManagementInjector.java
----------------------------------------------------------------------
diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultDependencyManagementInjector.java
b/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultDependencyManagementInjector.java
index e611973..731cdd8 100644
--- a/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultDependencyManagementInjector.java
+++ b/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultDependencyManagementInjector.java
@@ -82,13 +82,6 @@ public class DefaultDependencyManagementInjector
         }
 
         @Override
-        protected void mergeDependency_Optional( Dependency target, Dependency source, boolean
sourceDominant,
-                                                 Map<Object, Object> context )
-        {
-            // optional flag is not managed
-        }
-
-        @Override
         protected void mergeDependency_Exclusions( Dependency target, Dependency source,
boolean sourceDominant,
                                                    Map<Object, Object> context )
         {


Mime
View raw message