lightbend / config

configuration library for JVM languages using HOCON files
https://lightbend.github.io/config/
6.16k stars 965 forks source link

Spring Boot application properties integration #590

Open marceloverdijk opened 6 years ago

marceloverdijk commented 6 years ago

Typical Spring Boot application use a application.properties or application.yml to define application properties. Would it be possible to load such a file as source for Config?

In that way I would configure all properties in application.properties|application.yml (without having an application.conf) and libraries using Config for configuration would get these properties then.

michalmela commented 5 years ago

Not that I have any particular solution in mind right now, but how about, instead, to have a Spring Boot application configured with an appplication.conf and do away with the .properties and .yml files?

pjroth commented 5 years ago

This might be what you are looking for: https://stackoverflow.com/questions/38803381/spring-environment-backed-by-typesafe-config

michalmela commented 5 years ago

@pjroth The person asking the question explicitly stated he's not using Spring Boot. AFAIK Spring Boot configuration is not the same as a Spring Property Source (as, e.g., the former supports YAML OOTB).

pjroth commented 5 years ago

Ah true. I don't know if the link I shared will work with also work with spring-boot apps as well. I assumed it would be similar or at least point the OP in the right direction. Perhaps not.