diff --git a/spring-bootstrap-actuator/docs/Features.md b/spring-bootstrap-actuator/docs/Features.md index 19aa74ec40..c9d5791212 100644 --- a/spring-bootstrap-actuator/docs/Features.md +++ b/spring-bootstrap-actuator/docs/Features.md @@ -289,9 +289,12 @@ via `application.properties`). By default the Actuator adds an `/info` endpoint to the main server. It contains the commit and timestamp information from `git.properties` (if that file exists) and also any properties it finds in the -environment with prefix "info". To populate `git.properties` in a +environment with prefix "info". + +To populate `git.properties` in a Maven build you can use the excellent [git-commit-id-plugin](https://github.com/ktoso/maven-git-commit-id-plugin). + To populate the "info" map all you need to do is add some stuff to `application.properties`, e.g. @@ -299,6 +302,33 @@ To populate the "info" map all you need to do is add some stuff to info.app.description: My awesome service info.app.version: 1.0.0 +If you are using Maven you can automcatically populate info properties +from the project using resource filtering. In your `pom.xml` you +have (inside the `` element): + + + + src/main/resources + true + + + +and then in the `application.properties` you can refer to project +properties via placeholders, e.g. + + project.artifactId: myproject + project.name: Demo + project.version: X.X.X.X + project.description: Demo project for info endpoint + info.build.artifact: ${project.artifactId} + info.build.name: ${project.name} + info.build.description: ${project.description} + info.build.version: ${project.version} + +(notice that in the example we used `project.*` to set some values to +be used as fallbacks if the Maven resource filtering has for some +reason not been switched on). + ## Security - Basic Authentication To secure your endpoints just add Spring Security Javaconfig to the