slawekjaranowski opened a new pull request, #1091:
URL: https://github.com/apache/maven-enforcer/pull/1091
When more than one enforcer rule implementation is registered under the same
name,
the plugin silently picks one of them. A real example is
`enforceBytecodeVersion`,
which exists as a built-in rule and in
`org.codehaus.mojo:extra-enforcer-rules`.
Now a warning is logged in such case, e.g.:
[WARNING] Rule name enforceBytecodeVersion is ambiguous - found
implementations:
org.codehaus.mojo.extraenforcer.dependencies.EnforceBytecodeVersion,
org.apache.maven.enforcer.rules.dependency.EnforceBytecodeVersion, the used one
is: org.codehaus.mojo.extraenforcer.dependencies.EnforceBytecodeVersion. Please
check the plugin dependencies and remove rules libraries providing a rule with
the same name.
Implementations are found via `PlexusContainer.getComponentDescriptorList`,
so rule instances are not created.
Note: the built-in `EnforceBytecodeVersion` is annotated with
`@org.eclipse.sisu.Priority(10)`
in order to prevail, but the `org.eclipse.sisu` package is not exported by
Maven core to plugin realms,
so the annotation is not visible at runtime and the rule from
`extra-enforcer-rules`
(placed earlier on the plugin classpath) is used. This can be addressed in a
follow-up.
---
To make clear that you license your contribution under
the [Apache License Version 2.0, January
2004](https://www.apache.org/licenses/LICENSE-2.0)
check one of the following:
- [ ] I hereby declare this contribution to be licensed under the [Apache
License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0)
- [x] I hereby declare that I have filed an [Apache Individual Contributor
License Agreement](https://www.apache.org/licenses/icla.pdf).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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]