Build information is metadata that identifies an application build, including its version, build timestamp, and build environment. Spring Boot Actuator exposes it through the /info endpoint using BuildInfoContributor. section 15.3.1
Enable build information during the project build:
- Add the Spring Boot Maven Plugin's build-info goal, or enable buildInfo() in Gradle. section 15.3.1
- Package the application so the build produces build-info.properties inside the distributable JAR or WAR. section 15.3.1
- Request /info to inspect the running application's version, build time, host, and build user. section 15.3.1
Example response
A response can identify a Taco Cloud build with artifact "tacocloud", version "0.0.15-SNAPSHOT", and its build timestamp. Git commit information can be exposed alongside it when configured. section 15.3.1
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>build-info</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Use the Maven configuration listing to add the build-info goal to a Spring Boot project. section 15.3.1
