liveBook · Manning

BuildInfoContributor

As explained in Spring in Action, Sixth Edition

A Spring Boot Actuator InfoContributor implementation that exposes project build information from a build-info.properties file.

BuildInfoContributor is a built-in Spring Boot Actuator contributor that reads build-info.properties and adds project build details to the /info endpoint. section 15.3.1

Enable the generated metadata through the build system:

  • Configure the Spring Boot Maven Plugin with its build-info goal. section 15.3.1
  • Configure Gradle with springBoot { buildInfo() }. section 15.3.1
  • Package the resulting build-info.properties file in the distributable JAR or WAR. section 15.3.1

Build details returned by /info

A GET request can expose an object such as build.artifact, build.name, build.time, build.version, and build.group, making the running application version and build time visible. section 15.3.1

How Spring in Action, Sixth Edition covers it

How deep it goes
Explains automatic metadata generation and packaging, but does not detail BuildInfoContributor internals.
Examples
Uses Maven and Gradle configuration snippets plus a JSON response containing artifact, name, time, version, and group.
What it assumes
Assumes a Spring Boot project using Actuator and Maven or Gradle build configuration.
What you can do after
Operate Spring Boot Actuator to publish application version and build-time information through /info.
How it connects
Connects Spring Boot Actuator, the /info endpoint, Maven, Gradle, and build-info.properties.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spring in Action, Sixth Edition. The section links point to the parts of the book it draws on.