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
相关推荐
GlueNa2SiO310 小时前
第十八章 Linux故障排查与恢复
linux·服务器·笔记·学习
xian_wwq11 小时前
【学习笔记】Context Engineering,AI Agent 真正的内存管理-4/16
笔记·学习·context
疯狂打码的少年12 小时前
【数据结构】队列:定义、顺序队列与链式队列
数据结构·笔记
老马历写记13 小时前
Maven POM 依赖管理总结
java·maven·system·pom·optional
LeoZY_15 小时前
LinkScope 使用笔记:基于 OpenOCD 的通用硬件芯片调试助手
笔记·单片机·嵌入式硬件·开源软件
不会代码的小猴15 小时前
标准模板库(STL)
开发语言·c++·笔记·算法
爱莉希雅&&&15 小时前
K8s NFS+StorageClass+PV/PVC+Deployment 实战笔记
笔记·容器·kubernetes
影寂ldy16 小时前
SQL 索引(Index)完整笔记
数据库·笔记·sql
GlueNa2SiO316 小时前
06-Docker存储与数据持久化
笔记·学习·docker
上下求索,莫负韶华17 小时前
切面学习笔记
笔记·python·学习