spring-boot-starter-actuator /actuator/info 节点添加git提交版本信息

开发环境
spring boot 2.0.3
jdk8
maven3.3.9

添加依赖

<dependency>
    <groupId>org.springframework.bootgroupId>
    <artifactId>spring-boot-starter-actuatorartifactId>
dependency>

<build>
    <finalName>${project.artifactId}finalName>
    <plugins>
        <plugin>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-maven-pluginartifactId>
        plugin>
        <plugin>
            <groupId>pl.project13.mavengroupId>
            <artifactId>git-commit-id-pluginartifactId>
        plugin>
    plugins>
build>

构建编译之后会在target\classes目录下生成git.properties信息文件

配置yml,查看端点信息,full显示更多

management:
  info:
    git:
      mode: simple # full

访问端口:http://127.0.0.1:7366/actuator/info

spring-boot-starter-actuator /actuator/info 节点添加git提交版本信息_第1张图片

你可能感兴趣的:(SpringBoot)