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.gradleplugins {
id 'java'
id 'no.conta.git-info' version '1.0.1'
}
The plugin will automatically:
-
Generate a
git.propertiesfile inbuild/git-info/ -
Include it in your JAR’s resources at the root level
-
Run before the
processResourcestask
Configuration
Configure the plugin using the gitInfo extension:
build.gradlecontaGitInfo { // using defaults
enabled = true
addToResources = true
addToMetaInf = false
}