Fork me on GitHub

CheckMavenCentral

Checks that the POM complies with the rules required for uploading to Maven Central.

Properties
release

Disallows -SNAPSHOT versions if set to true. Defaults to true.

strict

Disallows <repositories> and <pluginRepositories> if set to true. Defaults to true.

<project>
  [...]
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.0.0-M3</version>
        <dependencies>
          <dependency>
            <groupId>org.kordamp.maven</groupId>
            <artifactId>pomchecker-enforcer-rules</artifactId>
            <version>1.0.0</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>enforce</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <CheckMavenCentral implementation="org.kordamp.maven.enforcer.checker.CheckMavenCentral"/>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  [...]
</project>