git-commit-id-plugin maven插件笔记(git commitId跟踪工具)

文章目录

      • maven依赖
      • [git.properties 例子](#git.properties 例子)

代码版本管理比较混乱,如何记录呢?
一种是手动记录,也可以实现,显得有点笨。
也可以通过插件。

maven依赖

xml 复制代码
<plugin>
  <groupId>pl.project13.maven</groupId>
  <artifactId>git-commit-id-plugin</artifactId>
  <version>4.9.10</version>
</plugin>

在线地址(华为云仓库):

https://repo.huaweicloud.com/repository/maven/pl/project13/maven/git-commit-id-plugin/4.9.10/

这样打包后,解压jar包。BOOT-INF\classes 下会有个文件git.properties 记录提交信息。

git.commit.id就是提交id。

注:使用该工具,注意先提交再打包,这样版本才一致。

git.properties 例子

bash 复制代码
#Generated by Git-Commit-Id-Plugin
git.branch=zktest
git.build.host=a-ttt-1
git.build.time=2024-05-30T16\:41\:00+0800
git.build.user.email=ttt@test
git.build.user.name=ttt
git.build.version=0.0.1-SNAPSHOT
git.closest.tag.commit.count=
git.closest.tag.name=
git.commit.author.time=2024-05-30T09\:46\:31+0800
git.commit.committer.time=2024-05-30T09\:46\:31+0800
git.commit.id=0b55bbbbbbbbbbbd2df32cd67
git.commit.id.abbrev=0b558ad
git.commit.id.describe=0b558ad-dirty
git.commit.id.describe-short=0b558ad-dirty
git.commit.message.full=提交信息
git.commit.message.short=提交信息简写
git.commit.time=2024-05-30T09\:46\:31+0800
git.commit.user.email=ttt@test
git.commit.user.name=ttt
git.dirty=true
git.local.branch.ahead=0
git.local.branch.behind=0
git.remote.origin.url=http\://git.51test/CRM.git
git.tags=
git.total.commit.count=76
相关推荐
llhm1 小时前
tsp学习笔记——LINUX SDK编译2(2)Kernel6.1 Linux
linux·笔记·学习
向日的葵0064 小时前
大模型之git操作(第五章)
git
wangcheng3034 小时前
关键词优化怎么理解最清楚
笔记
土星碎冰机5 小时前
ai自学笔记(3.安卓篇,制作app
android·笔记·ai
土星碎冰机6 小时前
ai自学笔记 (2.prompt 踩坑与优化)
笔记·ai·prompt·claude
pluviophile_s6 小时前
数据结构:第1讲:算法分析
数据结构·笔记
05候补工程师6 小时前
【硬核干货】用“算法”思维袭英语新题型:集合逆清晰除与降维打击解题法
经验分享·笔记·考研·算法·学习方法
许长安6 小时前
Redis 跳表实现详解
数据库·c++·经验分享·redis·笔记·缓存
June bug7 小时前
【雅思学习笔记】Part2话题词汇及表达
笔记·学习
Hehuyi_In7 小时前
postgres-howto 学习笔记
笔记·学习·postgresql·脚本·how to