This Gradle plugin derives your project’s version directly from the state of the Git repository, turning tags and commits into consistent semantic versions. It reads the most recent tag, the number of commits since that tag, and whether the working tree is dirty, then composes a deterministic version string. Teams can enforce patterns (for example, treating non-tagged builds as snapshots) and keep CI builds reproducible without hardcoding versions in build.gradle. The plugin integrates with Gradle’s project.version, so the computed version flows automatically into publishing, packaging, and artifact naming. It works well in branching workflows by incorporating branch or distance information, making debug artifacts easy to trace back to source. By centralizing version logic around Git history, it eliminates manual bumps and reduces mistakes when cutting releases across multiple modules.
Features
- Generates version strings based on Git tags and commit history
- Mimics git describe --tags --always --first-parent behavior
- Appends .dirty when repository contains uncommitted changes
- Automatically injects version logic into the Gradle project
- Useful for reproducible builds and CI version tracking
- Actively maintained with latest release version 4.0.0 (June 27, 2025)