From a7e1ec842d263301f32eb1195d1936d436c1db13 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Mon, 3 Nov 2014 11:10:33 +0000 Subject: [PATCH] Use @*@ delimiters in Maven resource filtering It *is* very useful to have filtering on by default, so that is now the case (in spring-boot-starter-parent). Users can filter resources by default by adding @*@ placeholders (so as not to clash with Spring ${} placeholders). Fixes gh-1199 --- .../src/main/resources/application.properties | 5 ++- .../SampleActuatorApplicationTests.java | 9 +++++ .../spring-boot-starter-parent/pom.xml | 36 ++++++++++++------- 3 files changed, 36 insertions(+), 14 deletions(-) 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 21d52efbf37..61ed523499f 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 5f09d09ead1..388077787a1 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 cb32a74acde..f6553a4f495 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}