We are using spring boot 1.3.1. I have following details in my application.yml file.
info:
build:
artifact: ${project.artifactId}
name: ${project.name}
description: ${project.description}
version: ${project.version}
I am building the war file and deploying it to tomcat. When I access /info endpoint, i don't see values are substituted.
I am not using 'spring-boot-maven-plugin' as i don't need to run the application standalone.
Does the filtering work for YML files by default?
Also, is there any example of showing application version on banner.txt file using maven project.version property?
After Dave's comment, I updated my application.yml file as shown below and it is working.
info:
build:
artifact: @project.artifactId@
name: @project.name@
description: @project.description@
version: @project.version@
Also, I found that application.version is not picked up in standalone tomcat for banner.txt file. Tomcat fails to read manifest.mf file. Spring boot issue: https://github.com/spring-projects/spring-boot/issues/3406
I don't think filtering is switched on in maven by default. If you use the spring-boot-starter-parent it is enabled, but the key for the placeholders is @..@
not ${..}
.
I don't know which version of spring boot you are using,
But for me version: @project.version@
did not work.
Instead version: #project.version#
worked for me.
My project is having following parent pom config :
<parent>
<artifactId>spring-boot-starter-parent</artifactId>
<groupId>org.springframework.boot</groupId>
<version>1.4.1.RELEASE</version>
<relativePath />
</parent>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With