Class PedanticPluginManagementLocationEnforcer
java.lang.Object
com.github.ferstl.maven.pomenforcers.AbstractPedanticEnforcer
com.github.ferstl.maven.pomenforcers.PedanticPluginManagementLocationEnforcer
- All Implemented Interfaces:
org.apache.maven.enforcer.rule.api.EnforcerRule,org.apache.maven.enforcer.rule.api.EnforcerRule2,org.apache.maven.enforcer.rule.api.EnforcerRuleBase
Enforces that only a well-defined set of POMs may declare plugin management.
### Example
<rules>
<pluginManagemenLocation implementation="com.github.ferstl.maven.pomenforcers.PedanticPluginManagementLocationEnforcer">
<!-- Only these POMs may declare plugin management -->
<pluginManagingPoms>com.example.myproject:parent,com.example.myproject:subparent</pluginManagingPoms>
</pluginManagemenLocation>
</rules>
- Since:
- 1.0.0
- Enforcer Rule ID:
PedanticEnforcerRule.PLUGIN_MANAGEMENT_LOCATION
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaccept(PedanticEnforcerVisitor visitor) protected voiddoEnforce(ErrorReport report) protected PedanticEnforcerRulevoidsetAllowParentPoms(boolean allowParentPoms) Indicates whether parent POMs are generally allowed to manage plugins.voidsetPluginManagingPoms(String pluginManagingPoms) Comma separated list of POMs that may declare<pluginManagement>.Methods inherited from class com.github.ferstl.maven.pomenforcers.AbstractPedanticEnforcer
execute, getCacheId, getHelper, getLevel, getPom, getProjectModel, isCacheable, isResultValidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.maven.enforcer.rule.api.EnforcerRuleBase
setLog
-
Constructor Details
-
PedanticPluginManagementLocationEnforcer
public PedanticPluginManagementLocationEnforcer()
-
-
Method Details
-
getDescription
- Specified by:
getDescriptionin classAbstractPedanticEnforcer
-
accept
- Specified by:
acceptin classAbstractPedanticEnforcer
-
doEnforce
- Specified by:
doEnforcein classAbstractPedanticEnforcer
-
setAllowParentPoms
public void setAllowParentPoms(boolean allowParentPoms) Indicates whether parent POMs are generally allowed to manage plugins.- Parameters:
allowParentPoms-- Since:
- 1.2.0
- Enforcer Configuration Parameter
- Default Value:
false
-
setPluginManagingPoms
Comma separated list of POMs that may declare<pluginManagement>. Each POM has to be defined in the formatgroupId:artifactId.- Parameters:
pluginManagingPoms- Comma separated list of POMs that may declare plugin management.- Since:
- 1.0.0
- Enforcer Configuration Parameter
- Default Value:
- n/a
-