diff --git a/spring-boot-samples/spring-boot-sample-actuator/src/main/resources/application.properties b/spring-boot-samples/spring-boot-sample-actuator/src/main/resources/application.properties index 21d52efbf3..61ed523499 100644 --- a/spring-boot-samples/spring-boot-sample-actuator/src/main/resources/application.properties +++ b/spring-boot-samples/spring-boot-sample-actuator/src/main/resources/application.properties @@ -18,4 +18,7 @@ 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@ diff --git a/spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/SampleActuatorApplicationTests.java b/spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/SampleActuatorApplicationTests.java index 5f09d09ead..388077787a 100644 --- a/spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/SampleActuatorApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/SampleActuatorApplicationTests.java @@ -145,6 +145,15 @@ public class SampleActuatorApplicationTests { entity.getBody().contains("\"hello\":1")); } + @Test + public void testInfo() throws Exception { + ResponseEntity entity = new TestRestTemplate().getForEntity( + "http://localhost:" + this.port + "/info", String.class); + assertEquals(HttpStatus.OK, entity.getStatusCode()); + assertTrue("Wrong body: " + entity.getBody(), + entity.getBody().contains("\"artifact\":\"spring-boot-sample-actuator\"")); + } + @Test public void testErrorPage() throws Exception { ResponseEntity entity = new TestRestTemplate("user", getPassword()) diff --git a/spring-boot-starters/spring-boot-starter-parent/pom.xml b/spring-boot-starters/spring-boot-starter-parent/pom.xml index cb32a74acd..f6553a4f49 100644 --- a/spring-boot-starters/spring-boot-starter-parent/pom.xml +++ b/spring-boot-starters/spring-boot-starter-parent/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 org.springframework.boot @@ -49,13 +50,6 @@ **/application.properties - - ${basedir}/src/main/resources - - **/application.yml - **/application.properties - - @@ -103,6 +97,17 @@ ${start-class} + + org.apache.maven.plugins + maven-resources-plugin + 2.6 + + + + @ + + + pl.project13.maven git-commit-id-plugin @@ -170,17 +175,22 @@ - + META-INF/spring.handlers - + META-INF/spring.factories - + META-INF/spring.schemas - - + + ${start-class}