0

I need some help to consume another .yml file that complement the original one in the application. Then I have a file filled by me(dev) however some configuration(as database infos) should be inserted by our clients.

The one which is in the application(application.yml) have general configs, the other on path C:\Users\Public\ datasource.yml have:

spring:
  datasource:
    platform: postgres
    driverClassName: org.postgresql.Driver
    url: jdbc:postgresql://localhost:5432/mydb
    username: foo
    password: bar

Has anyone done this before?

1 Answers1

1

configure the below annotation at your main configuration class

@PropertySource("classpath:datasource.yml")
abhinav kumar
  • 1,487
  • 1
  • 12
  • 20
  • I was receiving error because for files outside the project directory (example: C: \ Users \ Public) the extension must be .properties instead yml. – Hugo Vinícius Jun 02 '20 at 15:42