Ich habe genau das versucht, aber etwas fehlt oder ist falsch konfiguriert. Ich habe diese Dateien:
Code: Select all
application.yml
Code: Select all
spring:
application:
name: MyAppName
Code: Select all
application-dev.yml
Code: Select all
spring:
datasource:
url: jdbc:mysql://localhost:3307/mydevdb
driver-class-name: com.mysql.cj.jdbc.Driver
username: dbusr
password: dbpwd
jpa:
hibernate:
ddl-auto: update
show-sql: true
Code: Select all
application-prod.yml
Code: Select all
spring:
datasource:
url: jdbc:mysql://localhost:3307/myproddb
driver-class-name: com.mysql.cj.jdbc.Driver
username: dbusr
password: dbpwd
jpa:
hibernate:
ddl-auto: validate
Code: Select all
./gradlew bootRun -Dspring.profiles.active=dev