For a SpringBoot app :
I have resources in src/main/resources : it can be JSON, XML... doesn't matter
Some resources are dynamic, for example :
{
"url": "${propA.url}"
}
This propA.url is defined in application.properties :
propA.url=http://localhost
Is it possible when building the project to finally having the real value after mvn package :
{
"url": "http://localhost"
}
After compilation, it does not work.
The properties-maven-plugin can do this. In pom.xml:
Then the maven-resources-plugin will by default replace, for example, src/main/resources/app.json file if put like this:
Executing:
Will give you (if using the application.properties you mention above):