Am 12/29/16 um 02:12 schrieb Christian Schulte: > Am 12/29/16 um 00:41 schrieb Michael Osipov: >> Am 2016-12-28 um 22:51 schrieb Christian Schulte: >>> I just pushed a fix for this. I could also have made that transitive >>> dependency a direct one, where it is used, and could have left the scope >>> management in. >>> >>> "Dependency management overrides are not transitive." >> >> Just checked this commit. It ultimately means that <scope> is useless in >> dependency management unless you know all transitive dependencies in >> order not to break them. > > Maven and the resolver have a different way of applying management. In > Maven, the management is used as a source of default values to be used > when those values are not provided otherwise (POM authoring - direct - > you can declare everything yourself). The resolver uses it as a global > override (POM consumption - transitive - you cannot do anything about > those consumed POMs but need to able to do so -> management). It both > makes sense somehow. What is inconsistent is to override management in a > module and then consume that module transitively in another module as if > it were something outside the reactor. All of the issues presented on > dev@ so far were due to this (overridden management). > >> If this is how it should (I am neither pro nor cons) work, we should >> deprecate this element or at least put a big WARNING on it. > > We need to distinguish between the management applied when authoring a > POM and the management applied when consuming a POM. There is two > stories about it. In a multi-module project you are the author so you > just use the dependency management to get rid of redundant dependency > declarations (versions, scopes, etc. all in one place and left out > everywhere). When consuming a project, you want to control the > dependencies the same way so your management is used to apply your > declarations onto the consumed projects (global override). > > Your POMs - you are the author in full control of everything: > Do not override anything you have put into the management anywhere > because that is what the resolver does as soon as a module is consumed > transitively - either in the same reactor, or somewhere else.
Adding to this: The resolver does not know anything about the reactor or modules. It resolves dependencies no matter what. Maybe that way: There are no transitive modules and no special handling in resolving a transitive module or a transitive dependency. That's where the difference between direct and transitive is coming from. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org