Git Info
A Gradle plugin that automatically generates a git.properties
file
containing Git repository information and includes it in your JAR.
The plugin works well with Maven Publish Conventions.
Usage
build.gradle
plugins {
id 'java'
id 'no.conta.git-info' version '1.0.1'
}
The plugin will automatically:
-
Generate a
git.properties
file inbuild/git-info/
-
Include it in your JAR’s resources at the root level
-
Run before the
processResources
task
Configuration
Configure the plugin using the gitInfo
extension:
build.gradle
contaGitInfo { // using defaults
enabled = true
addToResources = true
addToMetaInf = false
}