Am 12/11/16 um 03:29 schrieb Igor Fedorenko: > Why do you say Dependency A is transitive? Maven plugin directly depends > on Dependency A, so I expect it to be present on the plugin classpath. > This is consistent with how project direct optional dependencies are > always present on classpath.
Yes. That's the POM resolution case. The plugin resolution is performed exactly the same way dependency resolution is performed. See below. If what you say is the intented behaviour (plugins need to be resolved the same way as POMs) then the core needs to be updated to actually perform the resolution that way. I am glad you are coming up with this. > > Note that the project does not *depend* on the plugin. From dependency > resolution point of view, the plugin is standalone "top-level" entity at > the same level as the project. > That means plugins need to be resolved the same way as POMs. And that means direct 'test', 'provided' and 'optional' dependencies need to be resolved as well. Last time I updated the core to do exactly that, it lead to issues like: <https://issues.apache.org/jira/browse/MPLUGIN-296> Currently only 'optional' direct dependencies are resolved. And that is due to a bug. <https://issues.apache.org/jira/browse/MRESOLVER-8> Easy to spot. I'll revert the changes to 'ScopeDependencySelector' and 'OptionalDependencySelector' in a few hours locally and the tests in 'DefaultDependencyCollectorTest' need to still pass. If one of the tests starts failing, the fix to MRESOLVER-8 is correct. There is no reason for the two classes to behave differently. The 'ScopeDependencySelector' handles the POM resolution vs. dependency resolution case correctly but differently to the 'OptionalDependencySelector'. That can't be correct. There is no way to handle plugin resolution differently than dependency resolution. So either 'OptionalDependencySelector' behaves incorrectly for dependency resolution of incorrectly for plugin resolution. Maybe we'll need to update classes 'ScopeDependencySelector' and 'OptionalDependencySelector' to make the mode of operation (transitive vs. direct) a property we can set from the core to make plugin resolution behave the same way it did before the fix (filtering out direct 'test' and 'provided' dependencies but not direct 'optional' dependencies to make that IT lacking any kind of meaningful - why? - description pass). Let's see. Regards, -- Christian --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
