修复git信息丢失, #2053
This commit is contained in:
21
pom.xml
21
pom.xml
@@ -448,13 +448,22 @@
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>pl.project13.maven</groupId>
|
||||
<artifactId>git-commit-id-plugin</artifactId>
|
||||
<version>4.9.10</version>
|
||||
<groupId>io.github.git-commit-id</groupId>
|
||||
<artifactId>git-commit-id-maven-plugin</artifactId>
|
||||
<version>9.0.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>get-the-git-infos</id>
|
||||
<goals>
|
||||
<goal>revision</goal>
|
||||
</goals>
|
||||
<phase>initialize</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<offline>true</offline>
|
||||
<failOnNoGitDirectory>false</failOnNoGitDirectory>
|
||||
<dateFormat>yyyyMMdd</dateFormat>
|
||||
<generateGitPropertiesFile>true</generateGitPropertiesFile>
|
||||
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
|
||||
<commitIdGenerationMode>full</commitIdGenerationMode>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user