-
Notifications
You must be signed in to change notification settings - Fork 10
CompoundPedanticEnforcer
Stefan Ferstl edited this page Jul 16, 2023
·
19 revisions
Since: 1.0.0
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.
<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>
<allowUnmanagedProjectVersionsInDependencies>true</allowUnmanagedProjectVersionsInDependencies>
<allowedUnmanagedProjectVersionPropertiesForDependencies>version,project.version</allowedUnmanagedProjectVersionPropertiesForDependencies>
<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>
<allowUnmanagedProjectVersionsInPlugins>true</allowUnmanagedProjectVersionsInPlugins>
<allowedUnmanagedProjectVersionPropertiesForPlugins>version,project.version</allowedUnmanagedProjectVersionPropertiesForPlugins>
<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</checkDependencyElements>
<checkDependencyManagementElements>true</checkDependencyManagementElements>
</compound>
</rules>
Option | Default | Description |
---|---|---|
warnOnly |
false | If set to true , the enforcer rule will only issue a warning in the log and not fail the build. Enabling this option is a good way to start using the enforcer rules in an already existing project. Since: 2.0.0 |
pomSectionPriorities |
n/a | See PedanticPomSectionOrderEnforcer.sectionPriorities. Since: 1.0.0 |
moduleOrderIgnores |
n/a | See PedanticModuleOrderEnforcer.ignoredModules. Since: 1.0.0 |
dependenciesOrderBy |
n/a | See PedanticDependencyOrderEnforcer.orderBy. Since: 1.0.0 |
dependenciesGroupIdPriorities |
n/a | See PedanticDependencyOrderEnforcer.groupIdPriorities. Since: 1.0.0 |
dependenciesArtifactIdPriorities |
n/a | See PedanticDependencyOrderEnforcer.artifactIdPriorities. Since: 1.0.0 |
dependenciesScopePriorities |
n/a | See PedanticDependencyOrderEnforcer.scopePriorities. Since: 1.0.0 |
dependencyManagementOrderBy |
n/a | See PedanticDependencyManagementOrderEnforcer.orderBy. Since: 1.0.0 |
dependencyManagementGroupIdPriorities |
n/a | See PedanticDependencyManagementOrderEnforcer.groupIdPriorities. Since: 1.0.0 |
dependencyManagementArtifactIdPriorities |
n/a | See PedanticDependencyManagementOrderEnforcer.artifactIdPriorities. Since: 1.0.0 |
dependencyManagementScopePriorities |
n/a | See PedanticDependencyManagementOrderEnforcer.scopePriorities. Since: 1.0.0 |
allowParentPomsForDependencyManagement |
n/a | See PedanticDependencyManagementLocationEnforcer.allowParentPoms. Since: 1.2.0 |
dependencyManagingPoms |
n/a | See PedanticDependencyManagementLocationEnforcer.dependencyManagingPoms. Since: 1.0.0 |
manageDependencyVersions |
n/a | See PedanticDependencyConfigurationEnforcer.manageVersions. Since: 1.0.0 |
allowUnmangedProjectVersions |
n/a | See PedanticDependencyConfigurationEnforcer.allowUnmanagedProjectVersions and Since: 1.0.0 |
allowUnmanagedProjectVersions |
n/a | See PedanticDependencyConfigurationEnforcer.allowUnmanagedProjectVersions and Since: 2.2.0 |
allowedUnmanagedProjectVersionProperties |
n/a | See PedanticDependencyConfigurationEnforcer.allowedUnmanagedProjectVersionProperties and Since: 2.2.0 |
allowUnmanagedProjectVersionsInDependencies |
n/a | See PedanticDependencyConfigurationEnforcer.allowUnmanagedProjectVersions. Since: 2.2.0 |
allowedUnmanagedProjectVersionPropertiesForDependencies |
n/a | See PedanticDependencyConfigurationEnforcer.allowedUnmanagedProjectVersionProperties. Since: 2.2.0 |
manageDependencyExclusions |
n/a | See PedanticDependencyConfigurationEnforcer.manageExclusions. Since: 1.0.0 |
compileDependencies |
n/a | See PedanticDependencyScopeEnforcer.compileDependencies. Since: 1.0.0 |
providedDependencies |
n/a | See PedanticDependencyScopeEnforcer.providedDependencies. Since: 1.0.0 |
runtimeDependencies |
n/a | See PedanticDependencyScopeEnforcer.runtimeDependencies. Since: 1.0.0 |
systemDependencies |
n/a | See PedanticDependencyScopeEnforcer.systemDependencies. Since: 1.0.0 |
testDependencies |
n/a | See PedanticDependencyScopeEnforcer.testDependencies. Since: 1.0.0 |
importDependencies |
n/a | See PedanticDependencyScopeEnforcer.importDependencies. Since: 1.0.0 |
pluginManagementOrderBy |
n/a | See PedanticPluginManagementOrderEnforcer.orderBy. Since: 1.0.0 |
pluginManagementGroupIdPriorities |
n/a | See PedanticPluginManagementOrderEnforcer.groupIdPriorities. Since: 1.0.0 |
pluginManagementArtifactIdPriorities |
n/a | See PedanticPluginManagementOrderEnforcer.artifactIdPriorities. Since: 1.0.0 |
allowParentPomsForPluginManagement |
n/a | See PedanticPluginManagementLocationEnforcer.allowParentPoms. Since: 1.2.0 |
pluginManagingPoms |
n/a | See PedanticPluginManagementLocationEnforcer.pluginManagingPoms. Since: 1.0.0 |
managePluginVersions |
n/a | See PedanticPluginConfigurationEnforcer.manageVersions. Since: 1.0.0 |
allowUnmanagedProjectVersionsInPlugins |
n/a | See PedanticPluginConfigurationEnforcer.allowUnmanagedProjectVersions. Since: 2.2.0 |
allowedUnmanagedProjectVersionPropertiesForPlugins |
n/a | See PedanticPluginConfigurationEnforcer.allowedUnmanagedProjectVersionProperties. Since: 2.2.0 |
managePluginConfigurations |
n/a | See PedanticPluginConfigurationEnforcer.manageConfigurations Since: 1.0.0 |
managePluginDependencies |
n/a | See PedanticPluginConfigurationEnforcer.manageDependencies Since: 1.0.0 |
dependencyElementOrdering |
n/a | See PedanticDependencyElementEnforcer.elementPriorities. Since: 2.0.0 |
checkDependencyElements |
n/a | See PedanticDependencyElementEnforcer.checkDependencies. Since: 2.0.0 |
checkDependencyManagementElements |
n/a | See PedanticDependencyElementEnforcer.checkDependencyManagement. Since: 2.0.0 |
pluginElementOrdering |
n/a | See PedanticPluginElementEnforcer.elementPriorities. Since: 2.0.0 |
checkPluginElements |
n/a | See PedanticPluginElementEnforcer.checkPlugins. Since: 2.0.0 |
checkPluginManagementElements |
n/a | See PedanticPluginElementEnforcer.checkPluginManagement. Since: 2.0.0 |