How is the properly way to use Quarkus profile in application.properties?

Viewed 1919

I have this application.properties:

security.key.reader=myservice-apikey-${quarkus.profile}-reader

And quarkus.profile always set to "prod":

security.key.reader=myservice-apikey-prod-reader

The documentation says programmatically the profile has to be retrieved using ProfileManager.getActiveProfile(), but there isn't any information about how we can use profiles in the properties.

A possible solution is:

%dev.security.key.reader=myservice-apikey-dev-reader
%test.security.key.reader=myservice-apikey-test-reader
%prod.security.key.reader=myservice-apikey-prod-reader

I would like to find another option because I have many keys for each environment.

Thanks

0 Answers
Related