Checks for SNAPSHOT dependencies in the dependency management block of a Maven POM.

ID
de.smartics.maven.enforcer.rule.NoSnapshotsInDependencyManagementRule
Parent
Since
1.0
de.smartics.maven.enforcer.rule.NoSnapshotsInDependencyManagementRule

The following properties are supported:

IDSinceDescriptionDefault
checkOnlyResolvedDependencies
1.0.1

If set to true only resolved dependencies are checked. Per default also declared dependencies are taken into account. That is: if a BOM is a snapshot, but does not have dependencies to snapshots, a value of false would, a value of true would not raise an issue.

false
onlyWhenRelease
1.0
Usually this rule should only be enforced on projects with a release version.
true

Usage Example

The following configuration shows the rule properties set to the default values.

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-enforcer-plugin</artifactId>
  <version>1.4.1</version>
  <executions>
    <execution>
      <id>enforce-project-rules</id>
      <phase>test</phase>
      <goals>
        <goal>enforce</goal>
      </goals>
      <configuration>
        <rules>
          <NoSnapshotDependenciesInDependencyManagementRule
            implementation="de.smartics.maven.enforcer.rule.NoSnapshotsInDependencyManagementRule">
            <onlyWhenRelease>true</onlyWhenRelease>
            <checkOnlyResolvedDependencies>false</checkOnlyResolvedDependencies>
          </NoSnapshotDependenciesInDependencyManagementRule>
        </rules>
	  </configuration>
    </execution>
  </executions>
  <dependencies>
    <dependency>
      <groupId>de.smartics.rules</groupId>
      <artifactId>smartics-enforcer-rules</artifactId>
      <version>1.0.1-SNAPSHOT</version>
    </dependency>
  </dependencies>
</plugin>