I believe what Christian is asserting is that if you so choose to manage the 
optional flag because that’s how you use a particular dependency within your 
multi-module application build that it should be retained. It may very well be 
that a set of modules need an optional dependency to compile but it truly is up 
to the user of your output to bring that dependency back in if they wish. To 
prevent it from losing the optional flag and ending up in the packaging within 
your own build is what this is trying to fix.

I agree with Christian from the perspective that if a user sets the parameter 
to be optional that it should not magically disappear on them in use in a child 
module. It’s not up to us how someone wants to manage their dependencies and I 
would expect by the principle of least surprise in this case the optional flag 
should not get stripped if a user sets it.

> On Jan 29, 2016, at 5:50 AM, Robert Scholte <[email protected]> wrote:
> 
> Hi,
> What interested me is that is seems to be the intention to NOT manage the 
> optional flag.[1]
> Why would you set the optional flag when using dependency management?
> 
> this just means, that if you want to use this dependency, you explicitly need 
> to set the optional to false? That doesn't feel right.
> Instead I would expect that in case of dependencyManagement you cannot set 
> the optional-tag.
> 
> Or am I missing something?
> 
> thanks,
> Robert
> 
> [1] https://issues.apache.org/jira/browse/MNG-4600
> 
> 
> Op Thu, 28 Jan 2016 17:49:38 +0100 schreef Christian Schulte 
> <[email protected]>:
> 
>> Can someone please take a look at this? MNG-5227 is already checked in (with 
>> IT) and I would not want to revert it. It is triggering a bug in Aether I 
>> just reported and provided a patch for. How to procceed?
>> 
>> 
>> Am 01/28/16 um 17:37 schrieb Christian Schulte (JIRA):
>>> 
>>>      [ 
>>> https://issues.apache.org/jira/browse/MNG-5227?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
>>>  ]
>>> 
>>> Christian Schulte reopened MNG-5227:
>>> ------------------------------------
>>> 
>>> This issue is blocked by [Aether Bug 
>>> 486740|https://bugs.eclipse.org/bugs/show_bug.cgi?id=486740].
>>> 
>>>> The 'optional' flag of a dependency should be manageable.
>>>> ---------------------------------------------------------
>>>> 
>>>>                 Key: MNG-5227
>>>>                 URL: https://issues.apache.org/jira/browse/MNG-5227
>>>>             Project: Maven
>>>>          Issue Type: Bug
>>>>          Components: Artifacts and Repositories
>>>>    Affects Versions: 3.0.3
>>>>            Reporter: Christian Schulte
>>>>            Assignee: Christian Schulte
>>>>            Priority: Minor
>>>>             Fix For: 3.4.0
>>>> 
>>>> 
>>>> {code}
>>>> <dependencyManagement>
>>>>   <dependencies>
>>>>     <dependency>
>>>>       <groupId>groupId</groupId>
>>>>       <artifactId>artifactId</artifactId>
>>>>       <version>version</version>
>>>>       <optional>false</optional> <!-- Ignored by Maven 2 & 3 in dependency 
>>>> management. -->
>>>>     </dependency>
>>>>   </dependencies>
>>>> </dependencyManagement>
>>>> {code}
>>> 
>>> 
>>> 
>>> --
>>> This message was sent by Atlassian JIRA
>>> (v6.3.4#6332)
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder, Takari and Apache Maven
http://twitter.com/jvanzyl
http://twitter.com/takari_io
---------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to