mirror of
https://github.com/apache/maven.git
synced 2025-02-24 19:36:45 +00:00
[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.
This commit is contained in:
parent
fd988e78e9
commit
f4ede96fd0
@ -316,7 +316,12 @@ public static Dependency toDependency( org.apache.maven.model.Dependency depende
|
||||
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;
|
||||
}
|
||||
|
@ -124,7 +124,11 @@ private Dependency convert( org.apache.maven.model.Dependency dependency, Artifa
|
||||
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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user