You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The interfaces EnforcerRule and EnforcerRule2 have been deprecated in favor of the new abstract class AbstractEnforcerRule. However this poses a big problem as our rule implementation already need to inherit from BannedImportGroupDefinition 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 from BannedImportGroupDefinition.
Changing this would break existing rule usages and introduce inconveniences when configuring the rule for simple use cases
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
The text was updated successfully, but these errors were encountered: