Skip to content

PedanticDependencyElementEnforcer

Stefan Ferstl edited this page Sep 2, 2021 · 2 revisions

Since: 2.0.0

This enforcer makes sure that elements in the and sections are ordered.

Example

<rules>
  <dependencyElements implementation="com.github.ferstl.maven.pomenforcers.PedanticDependencyElementEnforcer">
    <!-- Define the order within dependencies -->
    <elementPriorities>groupId,artifactId,version</elementPriorities>
    <!-- Check the dependency management section -->
    <checkDependencyManagement>true</checkDependencyManagement>
    <!-- Check the dependencies section -->
    <checkDependencies>true</checkDependencies>
  </dependencyElements>
</rules>

Configuration Options

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
elementPriorities groupId, artifactId, version, classifier, type, scope, systemPath, optional, exclusions 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. Since: 2.0.0
checkDependencies true Check the section. Since: 2.0.0
checkDependencyManagement true Check the section. Since: 2.0.0