AEM Run modes – which OSGI config gets picked-up? | Community
Skip to main content
Level 4
April 12, 2019
Solved

AEM Run modes – which OSGI config gets picked-up?

  • April 12, 2019
  • 5 replies
  • 4626 views

I have an osgi config which exists both in config.author and config.dev. And here is the run mode of my AEM server Run Modes = [dev-est, dev, crx3, author]. I am noticing that config.author OSGI is getting picked up before config.dev. I thought config.dev should take precedence over config.author but that’s not the case. When I delete config.author config, then only config.dev gets picked up. Can somebody explain this, please?

Run Modes = [dev-est, dev, crx3, author].

  1. config.author
  2. config.dev
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Ravi_Pampana

Hi Karanmahi,

I think the comparison of the OSGi configs will come down to a lexicographically string comparison and config.author is given preference than config.dev.

Try creating another run mode config.foo and remove config.author then config.dev should be given precedence than config.foo

Hope it clarifies your question.

5 replies

Ravi_Pampana
Community Advisor
Community Advisor
April 12, 2019

Hi,

Run modes will resolve in below order

  1. sling.properties file
  2. -r option
  3. system properties (-D)
  4. Filename detection

Refer Run Modes for more details

You should define folder like config.author.dev and config.author in order to pickup dev configuration as there are two names which are matching (author and dev). It will pickup more matching folder first.

karanmahiAuthor
Level 4
April 13, 2019

Hi Ravi,

I got the final run-mode mode from this url - http://localhost:4502/system/console/status-slingsettings which is [dev-est, dev, crx3, author]. Still, I don't understand why config.author OSGI is getting picked up before config.dev. I thought config.dev should take precedence over config.author but that’s not the case. My simple question is if I have only two run modes config.author and config.dev, which one should be picked up first and why?

Ravi_Pampana
Community Advisor
Ravi_PampanaCommunity AdvisorAccepted solution
Community Advisor
April 13, 2019

Hi Karanmahi,

I think the comparison of the OSGi configs will come down to a lexicographically string comparison and config.author is given preference than config.dev.

Try creating another run mode config.foo and remove config.author then config.dev should be given precedence than config.foo

Hope it clarifies your question.

smacdonald2008
Level 10
April 13, 2019

Great answer!

arunpatidar
Community Advisor
Community Advisor
April 13, 2019

If you want dev config should be picked up for author, then create config in config.author.dev

Arun Patidar