Hi,
I am using Gradle 4.9 for a pretty fresh project using spring-boot. I wanted to expand a property in my src/main/resources/application.properties file, namely the project.version property.
I am still a learner around Gradle, but there are examples around that should help (I thought).
so I tried first
processResources {
expand project.properties
}
But that failed because some files contain dollar-curly-braces notation that must not be treated by expansion, and Gradle SimpleTemplateEngine failed on them. Then I tried to be more specific:
processResources {
def props = ["version":version]
filesMatching ('**/application.properties') {
expand props
}
}
This does not longer throw an exception in Gradle, but later in Spring-Boot, because it cannot resolve the ${version} value of the project.version property in application.properties - This looks like the filesMatching clause does not catch the file, it goes into build folders unprocessed. I did not find any help yet on how to make property expansion more verbose, but maybe people can hint me if I made a syntax error or a wrong assumption somewhere?
Cheers,
Kai