Ban Property Prefix
This rule can enforce that no Maven property starts with any of the configured banned prefixes. It is the counterpart of requireProperty and is useful to forbid properties that are reserved for other tooling or are no longer supported.
The following parameters are supported by this rule:
- prefixes - the list of banned property name prefixes. Each entry may also contain several prefixes separated by commas.
- message - an optional message to the user if the rule fails. Default is: “Banned properties found (prefixes: …): …”.
The rule checks all properties of the current project and fails if any property name starts with one of the configured prefixes, listing every offending property.
Sample Plugin Configuration:
<project>
[...]
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.7.0</version>
<executions>
<execution>
<id>ban-property-prefix</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<banPropertyPrefix>
<prefixes>
<prefix>secured.system</prefix>
<prefix>internal.build</prefix>
</prefixes>
</banPropertyPrefix>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
[...]
</project>

