Skip to content

allegro/axion-release-plugin

Folders and files

NameName
Last commit message
Last commit date
Sep 26, 2023
Dec 26, 2017
Oct 11, 2023
Oct 19, 2021
Nov 28, 2023
Mar 8, 2017
Aug 21, 2018
Jan 24, 2020
Aug 21, 2018
Sep 16, 2014
May 22, 2023
Oct 31, 2023
Oct 18, 2021
Feb 12, 2021
Aug 3, 2022
Sep 26, 2023
Nov 28, 2023
Oct 2, 2022

Repository files navigation

axion-release-plugin

gradle release and version management plugin

Build Status Coverage Status readthedocs Maven Central Gradle Plugin Portal

Releasing versions in Gradle is very different from releasing in Maven. Maven came with maven-release-plugin which did all the dirty work. Gradle has no such tool and probably doesn't need it anyway. Evolution of software craft came to the point, when we start thinking about SCM as ultimate source of truth about project version. Version should not be hardcoded in pom.xml or build.gradle.

axion-release-plugin embraces this philosophy. Instead of reading project version from buildfile, it is derived from nearest tag in SCM (or set to default if nothing was tagged). If current commit is tagged commit, project has a release version. If there were any commits after last tag, project is in SNAPSHOT version. This very simple and intuitive philosophy, alongside with Semantic Versioning rules, makes it a lot easier to manage project versions along SCM tag versions.

JDK11+ & Gradle 6+ required.

Basic usage

plugins {
    id 'pl.allegro.tech.build.axion-release' version '1.15.1'
}

project.version = scmVersion.version
$ git tag
<empty list>

$ ./gradlew currentVersion
0.1.0-SNAPSHOT

$ ./gradlew release

$ git tag
v0.1.0

$ ./gradlew cV
0.1.0

$ git add -A && git commit -m "Updates something" && ./gradlew release

$ git tag
v0.1.0
v0.1.1

$ ./gradlew cV
0.1.1

Documentation

Documentation is available at axion-release read the docs.

License

axion-release-plugin is published under Apache License 2.0.