Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list
SOLVED

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

Avatar

Level 8

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