Class PedanticPluginElementEnforcer
java.lang.Object
com.github.ferstl.maven.pomenforcers.AbstractPedanticEnforcer
com.github.ferstl.maven.pomenforcers.PedanticPluginElementEnforcer
- All Implemented Interfaces:
org.apache.maven.enforcer.rule.api.EnforcerRule,org.apache.maven.enforcer.rule.api.EnforcerRule2
This enforcer makes sure that elements in the <pluginManagement> and <plugins> sections are ordered.
### Example
<rules>
<pluginElements implementation="com.github.ferstl.maven.pomenforcers.PedanticPluginElementEnforcer">
<!-- Define the order within plugins -->
<elementPriorities>groupId,artifactId,version</elementPriorities>
<!-- Check the plugin management section -->
<checkPluginManagement>true</checkPluginManagement>
<!-- Check the plugins section -->
<checkPlugins>true</checkPlugins>
</pluginElements>
</rules>
- Since:
- 2.0.0
- Enforcer Rule ID:
PedanticEnforcerRule.PLUGIN_ELEMENT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaccept(PedanticEnforcerVisitor visitor)protected voiddoEnforce(ErrorReport report)protected PedanticEnforcerRulevoidsetCheckPluginManagement(boolean checkPluginManagement)Check the <pluginManagement> section.voidsetCheckPlugins(boolean checkPlugins)Check the <plugins> section.voidsetElementPriorities(String elements)Comma-separated list of section elements in the order as they should appear.Methods inherited from class com.github.ferstl.maven.pomenforcers.AbstractPedanticEnforcer
execute, getCacheId, getHelper, getLevel, getPom, getProjectModel, isCacheable, isResultValid
-
Constructor Details
-
PedanticPluginElementEnforcer
public PedanticPluginElementEnforcer()
-
-
Method Details
-
setElementPriorities
Comma-separated list of section elements in the order as they should appear. This will overwrite the default order by putting all unspecified elements at the end.- Parameters:
elements- Comma separated list of elements as they should appear.- Since:
- 2.0.0
- Enforcer Configuration Parameter
- Default Value:
- groupId, artifactId, version, extensions, inherited, configuration, dependencies, executions
-
setCheckPlugins
public void setCheckPlugins(boolean checkPlugins)Check the <plugins> section.- Parameters:
checkPlugins-trueto check the <plugins> section,falseelse.- Since:
- 2.0.0
- Enforcer Configuration Parameter
- Default Value:
- true
-
setCheckPluginManagement
public void setCheckPluginManagement(boolean checkPluginManagement)Check the <pluginManagement> section.- Parameters:
checkPluginManagement-trueto check the <pluginManagement> section,falseelse.- Since:
- 2.0.0
- Enforcer Configuration Parameter
- Default Value:
- true
-
getDescription
- Specified by:
getDescriptionin classAbstractPedanticEnforcer
-
doEnforce
- Specified by:
doEnforcein classAbstractPedanticEnforcer
-
accept
- Specified by:
acceptin classAbstractPedanticEnforcer
-