我想在打包jar时在MANIFEST.MF文件中加入git分支信息,打包人,需要怎么配置?
现在这样的,并没有git信息,只有打包时间
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.4</version>
<configuration>
<timestampFormat>yyyy-MM-dd HH:mm:ss</timestampFormat>
<timestampPropertyName>buildTime</timestampPropertyName>
</configuration>
<executions>
<execution>
<id>create-timestamp</id>
<phase>validate</phase>
<goals>
<goal>create-timestamp</goal>
</goals>
</execution>
<execution>
<id>generate-buildNumber</id>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
<configuration>
<!--如果git仓库地址为 http/https-->
<scmConnectionUrl>scm:git:https://xxx.git</scmConnectionUrl>
<username>819048836@qq.com</username>
<password>xxx</password>
<!--<scmConnectionUrl>scm:git:git@gitlab.lab.com/ms.git</scmConnectionUrl>-->
<shortRevisionLength>8</shortRevisionLength>
</configuration>
</execution>
</executions>
<inherited>false</inherited>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifestEntries> <!--suppress UnresolvedMavenProperty -->
<Build-Time>${buildTime}</Build-Time>
</manifestEntries>
</archive>
</configuration>