Я попробовал именно это, но чего-то не хватает или неправильно настроено. У меня есть эти файлы:
Код: Выделить всё
application.yml:
spring:
application:
name: MyAppName
Код: Выделить всё
application-dev.yml:
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
Код: Выделить всё
application-prod.yml:
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
Код: Выделить всё
./gradlew bootRun -Dspring.profiles.active=dev
Подробнее здесь: https://stackoverflow.com/questions/793 ... pring-boot
Мобильная версия