Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.2.1, 3.0-beta-1, 3.0-beta-2
-
Fix Version/s: 2.2.2, 3.0-beta-3
-
Component/s: Artifacts and Repositories, Plugins and Lifecycle
-
Labels:None
-
Complexity:Intermediate
-
Testcase included:yes
-
Patch Submitted:Yes
-
Number of attachments :
Description
Plugin-level dependencies should use RUNTIME scope at all times. Using any other scope may alter the weighting given to the subgraph-choice algorithm used in transitive dependency resolution.
Plugin-level dependencies use compile scope by default. When transitive resolution takes place, compile scope takes precedence over runtime scope, causing the transitive dependency sub-graph of the plugin-level dependency to be activated over those of the plugin itself.
This happens even when the plugin's transitive dep is NEARER to the top level than the one brought in by that plugin-level dependency itself.
The result is that when a dep that's farther away is chosen over a nearer one, it can then be disabled by Maven choosing to disable its parent dep (the one that brought it in) in another part of the transitive resolution process.
This is a very subtle case where Maven is doing the wrong thing. The attached test case should make it clearer.
Issue Links
- is related to
-
MNG-4134
Conflict resolution with scope widening can cause transitive dependencies to be omitted
-
Patch to force all plugin-level dependencies to use scope: runtime. We could probably use a debug statement showing this scope being managed to runtime, but the patch works.