slawekjaranowski commented on PR #14190: URL: https://github.com/apache/maven/pull/14190#issuecomment-7287251189
> But what happens if the plugin itself uses Sisu with prioritized components? We may want to test this, as if plugin pulls sisu... I may be just red-herring-ing here, so we need proof. I did the experiment with maven-enforcer, which is exactly this case: the built-in `enforceBytecodeVersion` rule is annotated with `@org.eclipse.sisu.Priority(10)` and competes with the rule of the same name from `extra-enforcer-rules`. I built maven-3.10.x with and without this PR (base `2271fbc738`) and ran `enforcer:enforce` with `extra-enforcer-rules:1.12.1` as a plugin dependency. In a second variant I also added `org.eclipse.sisu:org.eclipse.sisu.inject:0.3.5` as a plugin dependency, an older Sisu than core's 1.1.2, so the plugin realm gets its own Sisu jar (confirmed by `Included: org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.3.5` in `-X`). | Maven | Sisu in plugin realm | Rule used | `org.eclipse.sisu.Priority` loaded from (`-Xlog:class+load`) | |---|---|---|---| | base | – | extra-enforcer-rules | – | | base | `sisu.inject:0.3.5` | extra-enforcer-rules | **twice**: `org.eclipse.sisu.inject-1.1.2.jar` and `org.eclipse.sisu.inject-0.3.5.jar` | | this PR | – | built-in (`@Priority` honoured) | – | | this PR | `sisu.inject:0.3.5` | built-in (`@Priority` honoured) | only `org.eclipse.sisu.inject-1.1.2.jar` | All builds succeed, with no linkage or class-loading errors. So even when a plugin pulls its own Sisu, the annotation comes from core and the priority works. Without this PR, the plugin's copy is a different `Priority` class, which is why the container ignores it today. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
