How to use environment variables of a project in the java library?

2/21/2022

I've created a plain java-maven library which can be used by other projects. In my library, I need to use few variables from env vars like System.getenv("ABC"). The project using this library will define these env vars and I want my library to use them. Project will be containerized i.e. it'll define these envs in its deployment file directly or in config-map. Kindly let me know how that can be done?

PS: If any config reqd, kindly suggest on library side but no change on project side.

-- raman bhadauria
docker
java
kubernetes
spring
spring-boot

0 Answers