Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.
SOLVED

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

Avatar

Level 9

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!

 

Screen Shot 2022-05-06 at 5.33.18 PM.png

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
1 Reply

Avatar

Correct answer by
Community Advisor