1

I defined the enforcer plugin within my parent pom like so:

<build>
 <pluginManagement>
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-enforcer-plugin</artifactId>
    <version>3.2.1</version>
        <configuration>
            <rules>
                <dependencyConvergence />
            </rules>
        </configuration>
    </plugin>
 </pluginManagement>
</build>

in the child pom it is simply under

<build>
 <plugins>
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-enforcer-plugin</artifactId>
    <version>3.2.1</version>
    <inherited>true</inherited>
  </plugin>
 </plugins>
</build>

running enforcer:enforce works in the parent pom itself (as expected). I clean installed the child pom and then ran the same command, but I was met with:

Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.2.1:enforce (default-cli) on project my-project: No rules are configured.

I can't figure out why the rule is being ignored or not inherited? The plugin seems to be inherited properly but not the rule?

Pompompurin
  • 165
  • 3
  • 14

0 Answers0