80.2 Generate git information
Both Maven and Gradle allow to generate a git.properties
file containing information about the state of your git
source code repository when the project was built.
For Maven users the spring-boot-starter-parent
POM includes a pre-configured plugin to generate a git.properties
file. Simply add the following declaration to your POM:
<build> <plugins> <plugin> <groupId>pl.project13.maven</groupId> <artifactId>git-commit-id-plugin</artifactId> </plugin> </plugins> </build>
Gradle users can achieve the same result using the gradle-git-properties
plugin
plugins { id "com.gorylenko.gradle-git-properties" version "1.4.6" }