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
相关推荐
问心无愧051312 小时前
ctf show web入门111
android·前端·笔记
来杯@Java14 小时前
学生选课管理系统(基于springboot+vue前后端分离的项目)计算机毕业设计java
java·spring boot·spring·vue·毕业设计·maven·mybatis
恋喵大鲤鱼14 小时前
git rebase
git·git rebase
和平宇宙17 小时前
AI笔记005. hermes-DeepSeek V4 Pro, 128K上下文引发的探索
前端·人工智能·笔记
十月的皮皮17 小时前
C语言学习笔记20260606- 求月份天数三种写法
c语言·笔记·学习
cmes_love18 小时前
Level 2逐笔成交历史数据下载方法笔记
数据库·笔记·oracle
Cloud_Shy61818 小时前
解读《Effective Python 3rd Edition》:从练气到老魔(第五章 Item 30 - 32)
开发语言·人工智能·笔记·python·学习方法
大志哥12318 小时前
idea+git插件+云备份实现项目新分支新建维护
git
问心无愧051319 小时前
ctf show web入门110
前端·笔记
恋喵大鲤鱼19 小时前
git merge
git·git merge