Class CompoundPedanticEnforcer
java.lang.Object
com.github.ferstl.maven.pomenforcers.AbstractPedanticEnforcer
com.github.ferstl.maven.pomenforcers.CompoundPedanticEnforcer
- All Implemented Interfaces:
org.apache.maven.enforcer.rule.api.EnforcerRule,org.apache.maven.enforcer.rule.api.EnforcerRule2
The compound enforcer aggregates any combination of the available pedantic
enforcer rules. Besides that it is easier to configure than the single rules,
it is also more efficient because it has to parse the POM file of each Maven
module only once.
### Example
<rules>
<compound implementation="com.github.ferstl.maven.pomenforcers.CompoundPedanticEnforcer">
<enforcers>POM_SECTION_ORDER,MODULE_ORDER,DEPENDENCY_MANAGEMENT_ORDER,DEPENDENCY_ORDER,DEPENDENCY_CONFIGURATION,DEPENDENCY_ELEMENT,DEPENDENCY_SCOPE,DEPENDENCY_MANAGEMENT_LOCATION,PLUGIN_MANAGEMENT_ORDER,PLUGIN_CONFIGURATION,PLUGIN_ELEMENT,PLUGIN_MANAGEMENT_LOCATION</enforcers>
<!-- POM_SECTION configuration -->
<pomSectionPriorities>groupId,artifactId,version,packaging</pomSectionPriorities>
<!-- MODULE_ORDER configuration -->
<moduleOrderIgnores;>dist-deb,dist-rpm</moduleOrderIgnores>
<!-- DEPENDENCY_ORDER configuration -->
<dependenciesOrderBy>scope,groupId,artifactId</dependenciesOrderBy>
<dependenciesScopePriorities>compile,runtime,provided</dependenciesScopePriorities>
<dependenciesGroupIdPriorities>com.myproject,com.mylibs</dependenciesGroupIdPriorities>
<dependenciesArtifactIdPriorities>commons-,utils-</dependenciesArtifactIdPriorities>
<!-- DEPENDENCY_MANAGEMENT_ORDER configuration -->
<dependencyManagementOrderBy>scope,groupId,artifactId</dependencyManagementOrderBy>
<dependencyManagementScopePriorities>compile,runtime,provided</dependencyManagementScopePriorities>
<dependencyManagementGroupIdPriorities>com.myproject,com.mylibs</dependencyManagementGroupIdPriorities>
<dependencyManagementArtifactIdPriorities>commons-,utils-</dependencyManagementArtifactIdPriorities>
<!-- DEPENDENCY_CONFIGURATION configuration -->
<manageDependencyVersions>true</manageDependencyVersions>
<allowUnmangedProjectVersions>true</allowUnmangedProjectVersions>
<manageDependencyExclusions>true</manageDependencyExclusions>
<!-- DEPENDENCY_ELEMENT configuration -->
<dependencyElementOrdering>true</dependencyElementOrdering>
<checkDependencyElements>true</checkDependencyElements>
<checkDependencyManagementElements>true</checkDependencyManagementElements>
<!-- DEPENDENCY_SCOPE configuration -->
<compileDependencies>com.example:mylib1,com.example:mylib2</compileDependencies>
<providedDependencies>javax.servlet:servlet-api</providedDependencies>
<runtimeDependencies>com.example:myruntimelib</runtimeDependencies>
<systemDependencies>com.sun:tools</systemDependencies>
<testDependencies>org.junit:junit,org.hamcrest:hamcrest-library</testDependencies>
<importDependencies>org.jboss:jboss-as-client</importDependencies>
<!-- DEPENDENCY_MANAGEMENT_LOCATION configuration -->
<allowParentPomsForDependencyManagement>true</allowParentPomsForDependencyManagement>
<dependencyManagingPoms>com.example.myproject:parent,com.example.myproject:subparent</dependencyManagingPoms>
<!-- PLUGIN_MANAGEMENT_ORDER configuration -->
<pluginManagementOrderBy>groupId,artifactId</pluginManagementOrderBy>
<pluginManagementGroupIdPriorities>com.myproject.plugins,com.myproject.testplugins</pluginManagementGroupIdPriorities>
<pluginManagementArtifactIdPriorities>mytest-,myintegrationtest-</pluginManagementArtifactIdPriorities>
<!-- PLUGIN_CONFIGURATION configuration -->
<managePluginVersions>true</managePluginVersions>
<managePluginConfigurations>true</managePluginConfigurations>
<managePluginDependencies>true</managePluginDependencies>
<!-- PLUGIN_ELEMENT configuration -->
<pluginElementOrdering>true</pluginElementOrdering>
<checkPluginElements>true</checkPluginElements>
<checkPluginManagementElements>true</checkPluginManagementElements>
<!-- PLUGIN_MANAGEMENT_LOCATION configuration -->
<allowParentPomsForPluginManagement>true</allowParentPomsForPluginManagement>
<pluginManagingPoms>com.myproject:parent-pom</pluginManagingPoms>
<!-- DEPENDENCY_ELEMENT -->
<dependencyElementOrdering>groupId,artifactid,version</dependencyElementOrdering>
<checkDependencyElements>true</heckDependencyElements>
<checkDependencyManagementElements>true</checkDependencyManagementElements>
</compound>
</rules>
- Since:
- 1.0.0
- Enforcer Rule ID:
- n/a
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaccept(PedanticEnforcerVisitor visitor)protected voiddoEnforce(ErrorReport report)protected PedanticEnforcerRulevoidsetEnforcers(String enforcers)Methods inherited from class com.github.ferstl.maven.pomenforcers.AbstractPedanticEnforcer
execute, getCacheId, getHelper, getLevel, getPom, getProjectModel, isCacheable, isResultValid
-
Constructor Details
-
CompoundPedanticEnforcer
public CompoundPedanticEnforcer()
-
-
Method Details
-
setEnforcers
-
getDescription
- Specified by:
getDescriptionin classAbstractPedanticEnforcer
-
accept
- Specified by:
acceptin classAbstractPedanticEnforcer
-
doEnforce
- Specified by:
doEnforcein classAbstractPedanticEnforcer
-