Introduce ruleName for rules configuration by slawekjaranowski · Pull Request #893 · apache/maven-enforcer (original) (raw)

@slawekjaranowski

We can define the same rule multiple times with different configuration
Each execution has the same default name, with ruleName we can differentiate them

@slawekjaranowski

We can define the same rule multiple times with different configuration Each execution has the same default name, with ruleName we can differentiate them

cstamas

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+0 Is good, and handy, but this relies on Plexus configuration/field injection.
@gnodet WDYT?

Bukama

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+0.5 (see comment, might be done in a separate PR, but should be considerd before first release of this features)

public String getName() {
return name;
String ruleName = rule.getRuleName();
return ruleName == null |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Names with only whitespace are allowed as isEmpty() only checks length == 0. isBlank() (JDK 11?) implies trim() I suggest to disallow whitespace rule names.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

content is pom tags are trimed by default

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})