Collect and display build information
This commit updates the Maven plugin to generate a `META-INF/boot/build.properties` file with various build-specific settings (group, artifact, name, version and build time). Additionally, the plugin can be configured to write an arbitrary number of additional properties. A new `BuildProperties` bean is automatically exposed when such a file is present. If that bean is present, an `InfoContributor` is automatically created to expose that information under the `build` key. As for the git contributor, it is possible to only display the core settings or everything using the `management.info.build.mode` property. See gh-2559
This commit is contained in:
@@ -18,10 +18,10 @@ shell.auth: spring
|
||||
#shell.auth.key.path: ${user.home}/test/id_rsa.pub.pem
|
||||
#shell.auth: simple
|
||||
spring.jmx.enabled: true
|
||||
info.group: @project.groupId@
|
||||
info.artifact: @project.artifactId@
|
||||
info.name: @project.name@
|
||||
info.version: @project.version@
|
||||
|
||||
spring.jackson.serialization.write_dates_as_timestamps=false
|
||||
|
||||
management.info.build.mode=full
|
||||
|
||||
management.trace.include=REQUEST_HEADERS,RESPONSE_HEADERS,ERRORS,PATH_INFO,\
|
||||
PATH_TRANSLATED,CONTEXT_PATH,USER_PRINCIPAL,PARAMETERS,QUERY_STRING,AUTH_TYPE,\
|
||||
|
||||
@@ -147,6 +147,10 @@ public class SampleActuatorApplicationTests {
|
||||
assertThat(entity.getBody())
|
||||
.contains("\"artifact\":\"spring-boot-sample-actuator\"");
|
||||
assertThat(entity.getBody()).contains("\"someKey\":\"someValue\"");
|
||||
assertThat(entity.getBody())
|
||||
.contains("\"java\":{", "\"source\":\"1.8\"", "\"target\":\"1.8\"");
|
||||
assertThat(entity.getBody())
|
||||
.contains("\"encoding\":{", "\"source\":\"UTF-8\"", "\"reporting\":\"UTF-8\"");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user