Open skuzzle opened 1 year ago
I reckon we could still make this work by not inheriting from BannedImportGroupDefinition
and instead copy its contents to the rule implementation. ~That's ugly to maintain though~
Just tried it out and it was pretty straight forward. Instead of delegating to the super class, we can just delegate to an actual instance of BannedImportGroupDefinition
.
The interfaces
EnforcerRule
andEnforcerRule2
have been deprecated in favor of the new abstract classAbstractEnforcerRule
. However this poses a big problem as our rule implementation already need to inherit fromBannedImportGroupDefinition
in order to provide convenient XML configuration.We probably need to give up on the convenience configuration in order to get rid of the deprecations.
Currently it is possible to either configure a single banned group or multiple groups. When configuring a single group, this group does not need to be nested in
<groups></groups>
. This is achieved by inheriting fromBannedImportGroupDefinition
.Changing this would break existing rule usages and introduce inconveniences when configuring the rule for simple use cases
See also: https://maven.apache.org/enforcer/enforcer-api/writing-a-custom-rule.html