Home

Gradle plugin to auto-increment patch version on each call to publish task by looking up the most recent version published in the configured maven repository.

semantic version plugin

Import

plugins {
    `maven-publish`
    id("dev.poolside.gradle.semantic-version") version "0.1.3"
}
$ ./gradlw publish
[...]
> Task :semanticVersion
Resolved published version of 'dev.poolside.test:my-library:0.1.4' to '0.1.5'
[...]

Usage

Auto mode

Basic full example, but it can also be used for subprojects and bom subprojects. However, make sure the publication version number is in the format of [\d]+\.[\d]+.

plugins {
    java
    `maven-publish`
    id("dev.poolside.gradle.semantic-version") version "0.1.3"
}
repositories {
    mavenCentral()
}

group = "dev.poolside.test"
version = "0.1"

publishing {
    publications {
        create("mavenJava") {
            artifactId = "my-library"
            from(components["java"])
        }
    }
}

Manual mode

If there’s a scenario in which you want to manually increment the semantic version. Therefore, the plugin will disable publishing if the version already exists in the repository.

semanticVersion {
    manual = true
}