<ForbidOverridingManagedDependenciesRule />
Forbids overriding dependency management of parent.
<ForbidOverridingManagedPluginsRule />
Forbids overriding plugin management of parent.
<ForbidDependencyManagementInSubModulesRule />
Forbids dependency management in submodules.
<excludes>
<exclude>javax.validation:validation-api</exclude>
</excludes>
The rules above can define excludes. The check is a simple startsWith on $groupId:$artifactId
<ManageAllModulesRule />
Checks if all submodules of a multimodule are defined in dependency management.
<build>
<plugins>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<dependencies>
<dependency>
<groupId>net.oneandone.maven</groupId>
<artifactId>ono-extra-enforcer-rules</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<configuration>
<rules>
<ForbidOverridingManagedDependenciesRule>
<excludes>
<!-- guava in parent is too old, so allow to override it -->
<exclude>com.google.guava:guava</exclude>
</excludes>
</ForbidOverridingManagedDependenciesRule>
<ForbidOverridingManagedPluginsRule />
<ForbidDependencyManagementInSubModulesRule />
<ManageAllModulesRule />
</rules>
</configuration>
</plugin>
</plugins>
</build>