Require Release Version

This rule checks that the current project is not a snapshot.

The following parameters are supported by this rule:

  • message - an optional message to the user if the rule fails.
  • failWhenParentIsSnapshot - if the parent should be checked. Default: true

Sample Plugin Configuration:

<project>
  [...]
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.2.1</version>
        <executions>
          <execution>
            <id>enforce-no-snapshots</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireReleaseVersion>
                  <message>No Snapshots Allowed!</message>
                </requireReleaseVersion>
              </rules>
              <fail>true</fail>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  [...]
</project>