I would like to define database url, username, password in one place. Currently I have
application.properties with
spring.datasource.url=....
spring.datasource.username=sa
spring.datasource.password=00
And pom.xml with
<plugin>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>4.1.2</version>
<configuration>
<url>....</url>
<user>sa</user>
<password>00</password>
</configuration>
</plugin>
So probably I need to reuse property values defined in application.properties.
This <password>${spring.datasource.password}</password> doesn't work.
Also I tried
<systemProperties>
<systemProperty>
<name>url</name>
<value>....</value>
</systemProperty>
...
</systemProperties>
Neither approach is working.
You can do the reverse by building a properties file from your pom file. In your properties file you'd use something like:
password=${pom.password}
And your pom file would have something like:
<password>your_db_password</password>
Then at:
mvn clean package
Maven will build your properties file.
Here's a simple tutorial: Add Maven Build Information ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With