Class PedanticPluginManagementOrderEnforcer
java.lang.Object
com.github.ferstl.maven.pomenforcers.AbstractPedanticEnforcer
com.github.ferstl.maven.pomenforcers.PedanticPluginManagementOrderEnforcer
- All Implemented Interfaces:
org.apache.maven.enforcer.rule.api.EnforcerRule,org.apache.maven.enforcer.rule.api.EnforcerRule2
This enforcer makes sure that all plugins in your plugin management section
are ordered. The ordering can be defined by any combination of groupId and
artifactId. Each of these attributes may be given a priority.
### Example
<rules>
<pluginManagementOrder implementation="com.github.ferstl.maven.pomenforcers.PedanticPluginManagementOrderEnforcer">
<!-- order by groupId and artifactId (default) -->
<orderBy>groupId,artifactId</orderBy>
<!-- all group IDs starting with com.myproject.plugins and com.myproject.testplugins should occur first -->
<groupIdPriorities>com.myproject.plugins,com.myproject.testplugins</groupIdPriorities>
<!-- all artifact IDs starting with mytest and myintegrationtest should occur first -->
<artifactIdPriorities>mytest-,myintegrationtest-</artifactIdPriorities>
</pluginManagementOrder>
</rules>
- Since:
- 1.0.0
- Enforcer Rule ID:
PedanticEnforcerRule.PLUGIN_MANAGEMENT_ORDER
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaccept(PedanticEnforcerVisitor visitor)protected voiddoEnforce(ErrorReport report)protected PedanticEnforcerRulevoidsetArtifactIdPriorities(String artifactIds)Comma-separated list of artifact IDs that should be listed first in the plugins declaration.voidsetGroupIdPriorities(String groupIds)Comma-separated list of group IDs that should be listed first in the plugins declaration.voidsetOrderBy(String pluginElements)Comma-separated list of plugin elements that defines the ordering.Methods inherited from class com.github.ferstl.maven.pomenforcers.AbstractPedanticEnforcer
execute, getCacheId, getHelper, getLevel, getPom, getProjectModel, isCacheable, isResultValid
-
Constructor Details
-
PedanticPluginManagementOrderEnforcer
public PedanticPluginManagementOrderEnforcer()
-
-
Method Details
-
setOrderBy
Comma-separated list of plugin elements that defines the ordering.- Parameters:
pluginElements- Comma-separated list of plugin elements that defines the ordering.- Since:
- 1.0.0
- Enforcer Configuration Parameter
- Default Value:
- groupId, artifactId
-
setGroupIdPriorities
Comma-separated list of group IDs that should be listed first in the plugins declaration. All group IDs that start with any of the prioritized group IDs in the given list, are required to be located first in the dependencies section.- Parameters:
groupIds- Comma separated list of group IDs.- Since:
- 1.0.0
- Enforcer Configuration Parameter
- Default Value:
- n/a
-
setArtifactIdPriorities
Comma-separated list of artifact IDs that should be listed first in the plugins declaration. All artifact IDs that start with any of the prioritized IDs in the given list, are required to be located first in the dependencies section.- Parameters:
artifactIds- Comma separated list of artifact IDs.- Since:
- 1.0.0
- Enforcer Configuration Parameter
- Default Value:
- n/a
-
getDescription
- Specified by:
getDescriptionin classAbstractPedanticEnforcer
-
accept
- Specified by:
acceptin classAbstractPedanticEnforcer
-
doEnforce
- Specified by:
doEnforcein classAbstractPedanticEnforcer
-