I am trying to generate git.properties
file in my project. I have added the git-commit-plugin
dependency in pom.xml
. Please find my code below
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>2.1.4</version>
<executions>
<execution>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
<configuration>
<verbose>true</verbose>
<dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
<dateFormat>MM-dd-yyyy '@' HH:mm:ss Z</dateFormat>
<generateGitPropertiesFile>true</generateGitPropertiesFile> <generateGitPropertiesFilename>src/main/resources/git.properties</generateGitPropertiesFilename>
<failOnNoGitDirectory>true</failOnNoGitDirectory>
</configuration>
</plugin>
Also added git.properties in gitignore file. But i cant generate the properties in my project.
I found the answer to my question. The above pom.xml has Plugins for git.properties in . In the same pom.xml I missed to add the included
<includes>
<include>**/*.properties</include>
</includes>
Also in add the following(besides to PluginManagement)
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
</plugin>
Hope this solves your problem to generate git.properties file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With