Shiva Bommanabathina
Shiva Bommanabathina

Reputation: 81

How we can organize different config profiles to use Quarkus profile in application.properties

I have different profiles based on environment wise and needs to load it. How i can achieve and also how to pass program arguments for Quarkus main application to take dev profile(spring.config.location=classpath:/config/dev/application.yml)

Is there a way to load databse configuration while starting @QuarkusMain. I have configured all the database configurations into one class and how this class can be load in main. Please suggest on this.

Upvotes: 2

Views: 6402

Answers (1)

Roberto Cortez
Roberto Cortez

Reputation: 1163

Quarkus 1.13 (and later), supports profile aware application.properties. Just name your file application-{profile}.properties and activate it with -Dquarkus.profile={profile}

If you want to load specific files, you can also use quarkus.config.locations. This is backed by SmallRye Config. Please check additional documentation here: https://smallrye.io/docs/smallrye-config/main/config/config.html

Upvotes: 6

Related Questions