I used another way may be can be helpful ,You can add a plugin in pom.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>default-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
<useDefaultDelimiters>false</useDefaultDelimiters>
<delimiters>
<delimiter>#</delimiter>
</delimiters>
<resources>
<resource>
<directory>src/main/resources/</directory>
<filtering>true</filtering>
<includes>
<include>*.yml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources/</directory>
<filtering>false</filtering>
<excludes>
<exclude>*.yml</exclude>
</excludes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
And create a banner.txt under resources like
,------.,--. ,--. ,---. ,--. ,--.,------. ,--. ,------.
| .---' \ `.' / / O \ | `.' || .--. '| | | .---'
| `--, .' \ | .-. || |'.'| || '--' || | | `--,
| `---. / .'. \ | | | || | | || | --' | '--.| `---.
`------''--' '--'`--' `--'`--' `--'`--' `-----'`------'
${application.title} ${application.version}
and assert in your application.yml file you have the properties
application:
title: Hello
version: V1
${application.version}
. Then, I reran./mvnw clean package
. Then, I ranjava -jar target/demo-0.0.1-SNAPSHOT.jar
. It printed0.0.1-SNAPSHOT
as expected. If this is not working for you, do you want to provide more details, like perhaps your banner.txt file? – Pity