需要快照版本

此规则检查当前项目是否不是发布。

此规则支持以下参数:

  • message - 如果规则失败,则向用户发送可选消息。
  • failWhenParentIsRelease - 如果应该检查父级。默认值:真

示例插件配置:

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