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
)
info.demo.string = "demo string"
info.demo.number = 123
info.demo.map = [key: 'value', other_key: 123]
The above config will result in the following JSON response from the info endpoint:
{
"demo": {
"string": "demo string",
"number": 123,
"map": {
"key": "value",
"other_key": 123
}
}
}
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.