Provided Info Sources

Configuration Info Source

The ConfigurationInfoSource returns configuration properties under the info key. In addition to string, integer and boolean values, more complex properties can be exposed as maps in the JSON output (if the configuration format supports it).

Info Source Example (application.groovy)

  1. info.demo.string = "demo string"
  2. info.demo.number = 123
  3. info.demo.map = [key: 'value', other_key: 123]

The above config results in the following JSON response from the info endpoint:

  1. {
  2. "demo": {
  3. "string": "demo string",
  4. "number": 123,
  5. "map": {
  6. "key": "value",
  7. "other_key": 123
  8. }
  9. }
  10. }

Configuration

The configuration info source can be disabled using the endpoints.info.config.enabled property.

Git Info Source

If a git.properties file is available on the classpath, the GitInfoSource exposes the values in that file under the git key. Generating of a git.properties file must be configured as part of your build. One easy option for Gradle users is the Gradle Git Properties Plugin. Maven users can use the Maven Git Commit ID Plugin.

Configuration

To specify an alternate path or name of the properties file, supply a custom value in the endpoints.info.git.location property.

The git info source can be disabled using the endpoints.info.git.enabled property.

Build Info Source

If a META-INF/build-info.properties file is available on the classpath, the BuildInfoSource exposes the values in that file under the build key. Generating a build-info.properties file must be configured as part of your build. One easy option for Gradle users is the Gradle Build Info Plugin. An option for Maven users is the Spring Boot Maven Plugin

Configuration

To specify an alternate path/name of the properties file, supply a custom value in the endpoints.info.build.location property.

The build info source can be disabled using the endpoints.info.build.enabled property.