From 8c82c50b0f92cda10a96952618f908c8c9f08ea8 Mon Sep 17 00:00:00 2001 From: lin <648540858@qq.com> Date: Wed, 7 Jan 2026 15:08:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dgit=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E4=B8=A2=E5=A4=B1=EF=BC=8C=20#2053?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 21 ++++++++++---- .../com/genersoft/iot/vmp/utils/GitUtil.java | 29 ++----------------- 2 files changed, 17 insertions(+), 33 deletions(-) diff --git a/pom.xml b/pom.xml index e6405c858..fc88e84d8 100644 --- a/pom.xml +++ b/pom.xml @@ -448,13 +448,22 @@ - pl.project13.maven - git-commit-id-plugin - 4.9.10 + io.github.git-commit-id + git-commit-id-maven-plugin + 9.0.1 + + + get-the-git-infos + + revision + + initialize + + - true - false - yyyyMMdd + true + ${project.build.outputDirectory}/git.properties + full diff --git a/src/main/java/com/genersoft/iot/vmp/utils/GitUtil.java b/src/main/java/com/genersoft/iot/vmp/utils/GitUtil.java index ca637dda7..e4b981987 100755 --- a/src/main/java/com/genersoft/iot/vmp/utils/GitUtil.java +++ b/src/main/java/com/genersoft/iot/vmp/utils/GitUtil.java @@ -1,5 +1,6 @@ package com.genersoft.iot.vmp.utils; +import lombok.Getter; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.PropertySource; import org.springframework.stereotype.Component; @@ -7,6 +8,7 @@ import org.springframework.stereotype.Component; /** * 一个优秀的颓废程序猿(CSDN) */ +@Getter @Component @PropertySource(value = {"classpath:git.properties" }, ignoreResourceNotFound = true) public class GitUtil { @@ -29,31 +31,4 @@ public class GitUtil { @Value("${git.commit.time:}") private String commitTime; - public String getGitCommitId() { - return gitCommitId; - } - - public String getBranch() { - return branch; - } - - public String getGitUrl() { - return gitUrl; - } - - public String getBuildDate() { - return buildDate; - } - - public String getCommitIdShort() { - return commitIdShort; - } - - public String getBuildVersion() { - return buildVersion; - } - - public String getCommitTime() { - return commitTime; - } }