Can we get environment variable from pom.xml into OSGi config? | Community
Skip to main content
Level 3
December 1, 2023
Solved

Can we get environment variable from pom.xml into OSGi config?

  • December 1, 2023
  • 2 replies
  • 1687 views
Hi, 
 
I am working on setting up an OSGi config using environment variables so they can be accessed on deployed environment on Cloud AEM, without the config values exposed in Github.

 

 

It says that we can set the environment variable under the "Environment Configuration" of Adobe Cloud Manager, and such an environment variable will be available in the pom.xml file per below:

 

<password>${env.CUSTOM_MYCO_REPOSITORY_PASSWORD}</password>

 

 

However, I need to use it in the OSGi config, not in the pom.xml file. Is it possible to grab the environment variable from the pom.xml file into the OSGi config?

 

I looked in the docs below, but was not able to find the answer:

 

 
Thank you,
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
December 1, 2023
aanchal-sikka
Community Advisor
Community Advisor
December 1, 2023

Hello @sean12341 

 

You might already be aware of 2 types of CM variables. 

- Variable visible in CM console

- Secret variables for passwords.

Just adding info here, incase its missed.

 

Details of both are available in link shared by @arunpatidar 

Aanchal Sikka