I need to access expanded/resolved Spring properties within my Gradle Build script, how do I do that?

57 Views Asked by At

Certain tools like Flyway essentially require to be configure twice, once in the Spring properties and once within the Gradle Plugin. What I like to do is just read the configuration set within the spring properties file in order to have the same configurations in both places. However, if the configuration is split up into environment specific files (application-DEV.properties), or if the properties reference other spring properties,

spring.flyway.url=${spring.datasource.url})

the Gradle Build cannot resolve those properties.

I currently have written a simple plugin in which I pass the environment variable's name in order to use Spring's provided PropertyResolver API, however, because I'm new to Gradle Plugins it turned out a bit awkward to use.

Are there any other ways/already existing plugins to use for this issue?

0

There are 0 best solutions below