[
https://jira.codehaus.org/browse/MNG-2589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=336487#comment-336487
]
Jörg Schaible commented on MNG-2589:
------------------------------------
I made this proposal 6 years ago and in the meanwhile I'd simply close it as
"won't fix".
With a little effort everyone can run this "runtime" model on his own. In
practice we use a common parent anyway where all dependencies are defined with
their versions (and sometimes also scope) in a depMgmt section. That will
effectively overwrite also everywhere the transitive deps. By adding runtime
scope for all those dependencies you will get the requested behavior and
require every project child to overwrite the scope again if necessary.
In practice we did not do it in the end, because Java sometimes requires
compile time if a component exposes types of a transitive dependency in its own
API. Our prominent example was Apache commons-lang. We ported our code
everywhere to commons-lang3 and wanted to set runtime scope for the old
commons-lang to avoid accidental usage.
However, as it turned out, it was not possible, because we used also
commons-configuration that throws an own ConversionException derived from an
Exception in old commons-lang. In consequence the old commons-lang had to be
visible for the compiler also.
> Inherit transitive dependencies with runtime scope
> --------------------------------------------------
>
> Key: MNG-2589
> URL: https://jira.codehaus.org/browse/MNG-2589
> Project: Maven 2 & 3
> Issue Type: Improvement
> Components: Dependencies
> Affects Versions: 2.0.4
> Reporter: Jörg Schaible
> Fix For: Issues to be reviewed for 3.x
>
>
> Transitive dependencies of scope "compile" should be inherited with scope
> "runtime" only. This would avoid unwanted usage of 3rd party packages and
> make explicit dependencies visible. It should be possible at least to run
> Maven in such a mode.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira