This rule can be used to force the absence of distributionManagement in your pom files.
The following parameters are supported by this rule:
Sample Plugin Configuration:
<project> [...] <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-enforcer-plugin</artifactId> <version>1.4</version> <executions> <execution> <id>no-distribution-management-at-all</id> <goals> <goal>enforce</goal> </goals> <configuration> <rules> <banDistributionManagement/> </rules> </configuration> </execution> </executions> </plugin> </plugins> </build> [...] </project>
The above configuration will prevent any declaration of distributionManagement in your pom files except in the parent.
Let use take a look at the following project which is a typical multi-module project.
+-- root (pom.xml) +-- m1 (pom.xml) +-- m2 (pom.xml)
Usually you should define the distributionManagement only once in your hierarchy.
company-parent (pom.xml)
+-- root (pom.xml) +-- m1 (pom.xml) +-- m2 (pom.xml)