mirror of https://github.com/apache/maven.git
[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 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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue