Fork me on GitHub

PomChecker Gradle Plugin

The PomChecker Gradle plugin provides goals to check the contents of a POM file. Its tasks will be run after their corresponding generateMavenPom<PublicationName>publication task runs.

Install

Option 1
buildscript {
    repositories {
        gradlePluginPortal()
    }
    dependencies {
        classpath 'org.kordamp.gradle:pomchecker-gradle-plugin:1.11.0'
    }
}
apply plugin: 'org.kordamp.gradle.pomchecker'
Option 2
plugins {
    id 'org.kordamp.gradle.pomchecker' version '1.11.0'
}

DSL

pomchecker {
    enabled
    bom
    release
    strict
    failOnError
    failOnWarning
}
Name Type Required Default Value Description

enabled

boolean

no

true

If false then all check taks will be disabled.

bom

boolean

no

false

If true then the checkBom task wll be added.

release

boolean

no

true

Disallows -SNAPSHOT versions if set to true.

strict

boolean

no

true

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

failOnError

boolean

no

true

Fails the build on error.

failOnWarning

boolean

no

false

Fails the build on warning.

Tasks

CheckBom

Name

checkBom<PublicationName>

Type

org.kordamp.gradle.plugin.checker.tasks.CheckBomTask

Checks that a POM is a minimal BOM.
Minimal BOM files contain the following elements:

  • <groupId>

  • <artifactId>

  • <version>

  • <dependencyManagement>

CheckMavenCentral

Name

checkMavenCentral<PublicationName>

Type

org.kordamp.gradle.plugin.checker.tasks.CheckMavenCentralTask

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