0

I'm trying to make use of Maven's (v3) resource filtering capabilities to replace some variables in my application.properties file, with a property in my pom.xml. The properties file resides in src/main/resources and contains:

application.version=${project.version}

My pom file contains:

<project ...>
...
<version>1.0.0</version>
...
<build>
  <resources>
    <resource>
        <directory>src/main/resources</directory>              
        <filtering>true</filtering>
    </resource>
  </resources>
  ...
</build>

When I run goal (via eclipse run config) clean process-resources package and take a look at the properties file in target/classes, nothing has changed... the value remains the same.

user1491636
  • 2,355
  • 11
  • 44
  • 71
  • 1
    everything seems fine, it should be replaced even when running from within Eclipse. Did you try to run it from command line, as a double check? moreover, you don't need to run `process-resources` then `package`, running `package` it will already run `process-resources` and any preceeding phase. – A_Di-Matteo Jul 05 '16 at 15:22
  • Yes, tried that as well... no luck. – user1491636 Jul 05 '16 at 15:45
  • I suspect it has something to do with my build plugin: `spring-boot-maven-plugin` – user1491636 Jul 05 '16 at 15:52

1 Answers1

3

Found the solution. Since I am using the spring-boot-starter-parent, there is a different required syntax for the property variables. Instead of ${...}, you must used @...@. Here is the reference that I used: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-1.3-Release-Notes#maven-resources-filtering

user1491636
  • 2,355
  • 11
  • 44
  • 71