Skip to content

Commit a384eb1

Browse files
committed
Describe the subtle shift in meaning of git.build.time when generated into git.properties.
1 parent 9777964 commit a384eb1

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,10 @@ It's really simple to setup this plugin; below is a sample pom that you may base
200200
which you can then normally read using new Properties().load(/**/)
201201
-->
202202

203-
<!-- this is false by default, forces the plugin to generate the git.properties file -->
203+
<!--
204+
This is false by default, forces the plugin to generate the git.properties file.
205+
Note that the functional meaning of git.build.time becomes different in a very subtle way (see later in this README)
206+
-->
204207
<generateGitPropertiesFile>true</generateGitPropertiesFile>
205208

206209
<!--
@@ -647,6 +650,20 @@ public GitRepositoryState(Properties properties)
647650
}
648651
```
649652

653+
Note on the generated git.build.time
654+
------------------------------------
655+
Note that when writing the git.porperties file the value *git.build.time* will only be updated when things in the commit information have changed.
656+
If you only change a bit of your code and rebuild/rerun you will see an older timestamp that you may have expected.
657+
658+
Essentially the functional meaning becomes **The latest build time when the git information was written to the git.properties file** .
659+
660+
The reason why this was done can be found in [issue 151](https://github.com/ktoso/maven-git-commit-id-plugin/issues/151).
661+
662+
If you need the actual *build time* then simply use the a filtered properties file that contains something like this
663+
```
664+
git.build.time=${git.build.time}
665+
```
666+
650667
Yet another way to use the plugin
651668
=================================
652669

0 commit comments

Comments
 (0)