gitprops is a Gradle plugin:
- provides an easy way to write out git information to the git properties file for usage by sprint boot's /info endpoint
See Grgit for details on the Git library used underneath, including configuration for authentication.
NOTE: requires Java 7 (or higher)
- add plugin repository to your buildscript
- apply plugin: com.homedepot.gitprops
- add dependsOn to include it in your build pipeline - project.tasks.jar.dependsOn('gitprops')
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath("com.homedepot.gitprops:GitPropsPlugin:1.0.8")
}
}
apply plugin: 'com.homedepot.gitprops'
- see also ./example/build.gradle
This very simple plugin makes uses of the incredible work done by Andrew Oberstar on the gradle-git plugin, which provides additional flexibility and functionality
Significant simplification of original plugin based on article by Lieven Doclo
- add environment sanity checks (git installed, in a git repository, etc)
- add additional error messages (windows specific problems)