Class MavenCentralChecker

java.lang.Object
org.kordamp.maven.checker.MavenCentralChecker

public class MavenCentralChecker extends Object
Checks if a POM complies with the rules for uploading to Maven Central. The following blocks are required:
  • <groupId>
  • <artifactId>
  • <version>
  • <name>
  • <description>
  • <url>
  • <licenses>
  • <scm>
All previous blocks may be supplied by a parent POM with the exception of <artifactId>. The following blocks are forbidden if strict = true
  • <repositories>
  • <pluginRepositories>
Since:
1.0.0
See Also:
  • Constructor Details

    • MavenCentralChecker

      public MavenCentralChecker()
  • Method Details

    • check

      public static void check(Logger log, org.apache.maven.project.MavenProject project, boolean release, boolean strict) throws PomCheckException
      Checks the resolved model of the given MaveProject for compliance.
      Parameters:
      log - the logger to use.
      project - the project to be checked.
      release - if true checks if version is not -SNAPSHOT.
      strict - if true checks that <repositories> and <pluginRepositories> are not present
      Throws:
      PomCheckException - if the POM is invalid
    • resolveParentName

      private static String resolveParentName(File directory, org.apache.maven.model.Model fullModel)
    • readProject

      private static org.apache.maven.project.MavenProject readProject(File pom)