I use git-commit-id-plugin
in my pom.xml as follows:
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>4.9.10</version>
<executions>
<execution>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
<configuration>
<dotGitDirectory>${project.basedir}/../../.git</dotGitDirectory>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>src/main/resources/git.properties</generateGitPropertiesFilename>
</configuration>
</plugin>
Then I build my maven project by Jenkins, in the generated git.properties
, the value of git.branch
is identical to the value of git.commit.id
, what I want is the git branch name, why would this happened, and how do I solve this? Any idea is appreciated.