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
相关推荐
yun685399212 小时前
读书之反思系统架构设计原则_个人笔记
笔记
d111111111d14 小时前
STM32中为什么会有APB1和APB2两个外设有什么区别
笔记·stm32·单片机·嵌入式硬件·学习
杂鱼豆腐人14 小时前
pnpm环境下防止误使用npm的方法
前端·git·npm·node.js·git bash
71-315 小时前
C语言练习题——判断水仙花数(0-100000)
c语言·笔记·学习
摇滚侠15 小时前
GIT版本管理工具轻松入门 | TortoiseGit,Git 介绍软件安装配置,笔记01
笔记·git
锦轩韶华16 小时前
计网期末复习--选择题
笔记
郭庆汝16 小时前
(三)自然语言处理笔记——Transformer
笔记·自然语言处理·transformer
山有木兮木有枝_16 小时前
“误操作导致 feat 功能未生效,尽管 merge 已完成”
git
百锦再17 小时前
第14章 智能指针
android·java·开发语言·git·rust·go·错误
d111111111d17 小时前
STM32外设学习--USART串口外设--学习笔记。
笔记·stm32·单片机·嵌入式硬件·学习