how do I apply different values to an OSGI config service depending on runmode? | Community
Skip to main content
jayv25585659
Level 8
May 6, 2022
Solved

how do I apply different values to an OSGI config service depending on runmode?

  • May 6, 2022
  • 1 reply
  • 565 views

so I have something like these:

@AttributeDefinition( name = "Google URL", description = "", defaultValue = "https://www.google.com", type = AttributeType.STRING) String googleURL() default "https://www.google.com";

 

I want to change the value of the variable when I'm developing in my local AEM so I created this file /apps/myapps/config/config.local/com.myapps.core.config.mysettings.xml

 

<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="sling:OsgiConfig" googleURL = "https://www.bing.com"

 

When I open the config in configMgr, the value is still pointing to google.com.

 

Any ideas what I could be doing wrong?

 

(from memory, this works fine in our hosted environments)

 

Thanks!

 

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

1 reply

Himanshu_Jain
Community Advisor
Himanshu_JainCommunity AdvisorAccepted solution
Community Advisor
May 6, 2022