I am trying to setup the enforcer plugin for maven to enforce a minimum Java version. However, whenever I try to run mvn enforcer:enforce
, I get:
The parameters 'rules' for goal org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce are missing or invalid
Here is the relevant portion of my pom file:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.3.1</version>
<executions>
<execution>
<id>enforce-java</id>
<phase>validate</phase>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireJavaVersion>
<version>(1.7.0-20,)</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
I also tried replacing the <requireJavaVersion>
block with <alwaysPass/>
, in case something was invalid, but it still failed with the same error.