maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benjamin Bentmann (JIRA)" <>
Subject [jira] Commented: (MNG-4761) Plugin-level dependency scope causes some plugin classpaths to be incorrect
Date Wed, 11 Aug 2010 20:33:33 GMT


Benjamin Bentmann commented on MNG-4761:

For future reference, the failing test scenario centeres around the following dirty tree for
the plugin depencencies:
+- override:0.1:compile
|  \- middle:0.1:compile        <-----------\
|     \- required:0.1:compile    <---\      |
+- direct:0.1:runtime                (a)    |
|  +- required:0.1:runtime       <---/      |
|  \- middle:0.1:runtime        <--------- (b)
|     \- required:0.1:runtime               |
\- middle:0.2:runtime           <-----------/
During resolution of conflict (a), the node {{required:0.1:runtime}} will be disabled in favor
of {{required:0.1:compile}}, although the runtime-scope dependency is nearer, i.e. Maven's
usual conflict resolution strategy of nearest-wins is violated here. When conflict (b) is
resolved, all {{middle:0.1:*}} nodes including their children will be disabled, thereby completely
losing {{required:0.1}} on the plugin class path.

So while using runtime scope for the project-level plugin dependencies workarounds the problem,
the issue remains for ordinary project dependency resolution. I wonder if it got filled already.

> Plugin-level dependency scope causes some plugin classpaths to be incorrect
> ---------------------------------------------------------------------------
>                 Key: MNG-4761
>                 URL:
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Artifacts and Repositories, Plugins and Lifecycle
>    Affects Versions: 2.2.1, 3.0-beta-1, 3.0-beta-2
>            Reporter: John Casey
>            Assignee: John Casey
>             Fix For: 2.2.2, 3.0-beta-3
>         Attachments: MNG-4761-mvn3b2.patch, MNG-4761-mvn3b2.reformatted.patch,
> 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
> 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.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message