648540858
2023-01-10 4babf2b47b894c2fc445db46c00d88efbbecc1d0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package com.genersoft.iot.vmp.utils;
 
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
 
/**
 * 一个优秀的颓废程序猿(CSDN)
 */
@Component
@PropertySource(value = {"classpath:git.properties" }, ignoreResourceNotFound = true)
public class GitUtil {
 
    @Value("${git.branch:}")
    private String branch;
    @Value("${git.commit.id:}")
    private String gitCommitId;
    @Value("${git.remote.origin.url:}")
    private String gitUrl;
    @Value("${git.build.time:}")
    private String buildDate;
 
    @Value("${git.build.version:}")
    private String buildVersion;
 
    @Value("${git.commit.id.abbrev:}")
    private String commitIdShort;
 
    @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;
    }
}