From 03846e4a19f57dc7898b161d96d57a8aa3789bcf Mon Sep 17 00:00:00 2001 From: MK13 Date: Thu, 20 Jun 2019 16:13:45 +0200 Subject: [PATCH] Add property 'db.name' to enable config of DB connection during build time --- financer-server/pom.xml | 1 + .../resources/config/application-postgres.properties | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/financer-server/pom.xml b/financer-server/pom.xml index 2ad6089..e482314 100644 --- a/financer-server/pom.xml +++ b/financer-server/pom.xml @@ -19,6 +19,7 @@ jar hsqldb,dev + financer diff --git a/financer-server/src/main/resources/config/application-postgres.properties b/financer-server/src/main/resources/config/application-postgres.properties index 1eeea1c..e38a0b0 100644 --- a/financer-server/src/main/resources/config/application-postgres.properties +++ b/financer-server/src/main/resources/config/application-postgres.properties @@ -1,8 +1,11 @@ spring.flyway.locations=classpath:/database/postgres,classpath:/database/common -spring.datasource.url=jdbc:postgresql://localhost/financer -spring.datasource.username=financer -spring.datasource.password=financer +# Placeholder @db.name@ maps to the property db.name in the server POM. +# Its default value is 'financer' +# Enables easy configuration of DB name/user to use at build time +spring.datasource.url=jdbc:postgresql://localhost/@db.name@ +spring.datasource.username=@db.name@ +spring.datasource.password=@db.name@ # See https://github.com/spring-projects/spring-boot/issues/12007 -spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true \ No newline at end of file +spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true