Reputation: 435
I checked out spring-boot project from:
https://github.com/spring-projects/spring-boot
and after running spring-boot-sample-actuator with mvn spring-boot:run and navigating to http://localhost:8080/info
I see:
{version: "@project.version@", artifact: "@project.artifactId@", group: "@project.groupId@", name: "@project.name@"}
It seems that Automatic property expansion using Maven (also exlained here http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#production-ready-application-info-automatic-expansion) is not working.
What am I missing, how to make it work?
Upvotes: 1
Views: 887
Reputation: 3354
The thing is that the spring-boot-maven-plugin tries first to be able to make the developer productive. In short, when a path/file is both present in target/classes and in the sources or resources (such as application.properties), it will delete the contents under target/classes. This is clearly visible here.
So as it is deleting the target/classes/application.properties, and adding the project resources to the classpath (so adding here src/main/resources/application.properties), you can only get the non-filtered file.
Fortunately, you can disable this behaviour by adding this flag to the command line:
-Drun.addResources=false
or in the POM plugin configuration
<addResources>false</addResources>
Upvotes: 2