Overview ==================================================================================================================== This file should give you an overview on how to use the generated properties within your project. Basic configuration / Basic usage of the plugin ---------------- It's really simple to setup this plugin; below is a sample plugin configuration that you may paste into the `` section of your **pom.xml** to get started quickly. This will get you a properties file `git.properties` with build time, project version and git commit id (both abbreviated and full). For more in-depth explanation of all options read the next section. ```xml io.github.git-commit-id git-commit-id-maven-plugin 5.0.0 get-the-git-infos revision initialize true ${project.build.outputDirectory}/git.properties ^git.build.(time|version)$ ^git.commit.id.(abbrev|full)$ full ``` Configuration options in-depth / Full usage of the plugin ---------------- It's really simple to setup this plugin; below is a sample pom that you may base your **pom.xml** on. Note that it binds to the initialize phase by default such that all Git properties are available for use throughout the build lifecycle. ```xml 4.0.0 pl.project13.maven my-git-plugin-sample-app war 0.1 my-git-plugin-sample-app http://www.project13.pl src/main/resources true **/*.properties **/*.xml io.github.git-commit-id git-commit-id-maven-plugin 5.0.0 get-the-git-infos revision initialize validate-the-git-infos validateRevision package validating project version ${project.version} true ``` Based on the above part of a working POM you should be able to figure out the rest, I mean you are a maven user after all... ;-) All options are documented in the code, so just use `ctrl + q` (intellij @ linux) or `f1` (intellij @ osx) when writing the options in pom.xml - you'll get examples and detailed information about each option (even more than here). Validation Usage Example ---------------- ```xml validating project version ${project.version} validating git dirty ${git.dirty} false validating current commit has a tag ${git.closest.tag.commit.count} 0 ``` Required Configuration for validation to work: If you plan to use this feature you'll want to know that the validation will be executed inside an additional mojo. Inside your pom you thus may want to add an additional execution tag that triggers the execution of the validation plugin. You can also change the default phase of each execution by adding a `phase` definition. ```xml get-the-git-infos revision validate-the-git-infos validateRevision package ``` *Note* : In order to be able to validate the generated git-properties inside the pom itself you may need to set the configuration `true`. Generated properties --------------------- Refer to [this](https://github.com/git-commit-id/git-commit-id-plugin-core/blob/master/src/main/java/pl/project13/core/GitCommitPropertyConstant.java) to get an overview what properties can be generated by the plugin. Keep in mind that all properties listed there will be prefixed with the configurable prefix (`git.` by default).