Provided Info Sources

Configuration Info Source

The ConfigurationInfoSource will return 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 will result 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 will expose the values in that file under the git key. Generating of a git.properties file will need to be configured as part of your build. One easy option for Gradle users is the Gradle Git Properties Plugin. Maven users can look at the Maven Git Commit Id Plugin.

Configuration

To specify an alternate path/name of the properties file, you can 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 will expose the values in that file under the build key. Generating of a build-info.properties file will need to be configured as part of your build. One easy option for Gradle users is the Gradle Build Info Plugin. Another option for Maven users is the Spring Boot Maven Plugin

Configuration

To specify an alternate path/name of the properties file, you can 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.