中文字幕精品亚洲无线码二区,国产黄a三级三级三级看三级,亚洲七七久久桃花影院,丰满少妇被猛烈进入,国产小视频在线观看网站

springboot~關于(yu)打包時(shi)記(ji)錄當前git信息

Maven打包發布版本可能會遇到自己的提交不起作用的情況,排查比較困難,可能需要拉下服務器上包,反編譯查看是否包含自己的提交記錄。如果使用的是GIT作為SCM,可以使用 git-commit-id-plugin插件
該插件在打包時生產一個git.properties文件,里面記錄本次git提交的信息。

#Generated by Git-Commit-Id-Plugin
git.build.time=2022-07-28 09\:15\:53
git.build.version=1.0.0
git.commit.id=dc8103b5cf9d51d59169e0682e9990456a72f231
git.commit.id.abbrev=dc8103b
git.commit.id.describe=dc8103b-dirty
git.commit.id.describe-short=dc8103b-dirty
git.commit.message.full=update cache log
git.commit.message.short=update cache log
git.commit.time=2022-07-28 08\:58\:43
  • 可以在父項目中添加這個插件,這樣子項目也就具有了這個能力
  <!--打包jar 與git commit 關聯插件-->
<plugin>
    <groupId>io.github.git-commit-id</groupId>
    <artifactId>git-commit-id-maven-plugin</artifactId>
    <version>${git.commit.plugin}</version>
    <executions>
        <execution>
            <id>get-the-git-infos</id>
            <goals>
                <goal>revision</goal>
            </goals>
            <phase>initialize</phase>
        </execution>
    </executions>
    <configuration>
        <failOnNoGitDirectory>false</failOnNoGitDirectory>
        <generateGitPropertiesFile>true</generateGitPropertiesFile>
        <!--因為項目定制了jackson的日期時間序列化/反序列化格式,因此這里要進行配置,不然通過management.info.git.mode=full進行完整git信息監控時會存在問題-->
        <dateFormat>yyyy-MM-dd HH:mm:ss</dateFormat>
        <includeOnlyProperties>
            <includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
            <includeOnlyProperty>^git.commit.(id|message|time).*$</includeOnlyProperty>
        </includeOnlyProperties>
    </configuration>
</plugin>
posted @ 2022-07-28 09:25  張占嶺  閱讀(727)  評論(0)    收藏  舉報