Class BanPropertyPrefix
java.lang.Object
org.apache.maven.enforcer.rule.api.AbstractEnforcerRuleBase
org.apache.maven.enforcer.rule.api.AbstractEnforcerRule
org.apache.maven.enforcer.rules.AbstractStandardEnforcerRule
org.apache.maven.enforcer.rules.property.BanPropertyPrefix
- All Implemented Interfaces:
EnforcerRuleBase
@Named("banPropertyPrefix")
public final class BanPropertyPrefix
extends AbstractStandardEnforcerRule
This rule checks that no Maven property starts with any of the configured banned prefixes and fails the build if
one or more offending properties are found. Each prefix entry may also contain several prefixes separated by
commas. This is useful to forbid properties that are reserved for other tooling or no longer supported.
- Since:
- 3.7.0
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()This is the interface into the rule.normalizePrefixes(List<String> prefixes) voidsetPrefixes(List<String> prefixes) toString()Methods inherited from class AbstractStandardEnforcerRule
formatLocation, getMessage, setMessageMethods inherited from class AbstractEnforcerRule
getCacheId, getLevel, getRuleNameMethods inherited from class AbstractEnforcerRuleBase
getLog, setLog
-
Field Details
-
PREFIX_SEPARATOR
- See Also:
-
MESSAGE_SEPARATOR
- See Also:
-
prefixes
-
project
private final org.apache.maven.project.MavenProject project
-
-
Constructor Details
-
BanPropertyPrefix
@Inject public BanPropertyPrefix(org.apache.maven.project.MavenProject project)
-
-
Method Details
-
setPrefixes
-
getPrefixes
-
execute
Description copied from class:AbstractEnforcerRuleThis is the interface into the rule. This method should throw an exception containing a reason message if the rule fails the check. The plugin will then decide based on the fail flag and rule level if it should stop or just log the message as a warning.- Specified by:
executein classAbstractEnforcerRule- Throws:
EnforcerRuleException- the enforcer rule exception
-
normalizePrefixes
-
toString
-