Create Custom OSGi Configuration In AEM

Mayur Satav
Nov 30, 2021
Create Custom OSGi Configuration In AEM by Mayur Satav

Open Service Gateway Initiative that is OSGi is a fundamental element in the technology stack of Adobe Experience Manager (AEM) which makes it modular. OSGi provides different configurations and also we can create our own custom configuration as per requirement.

Step 1 First of all create an interface whose public methods will represent the fields in our configuration.

How to create custom OSGi Configuration in AEM

Create an interface named under.\aem\core\src\main\java\com\demoproject\core\services\” and paste the following code into it.

Step 2 Now Create an implementation class for our interface CustomConfig as below.

Step 3 Now create JSON file for the default values of our configuration. Create” under.“\aem\ui.config\src\main\content\jcr_root\apps\demoproject\osgiconfig\config\”

How to create custom OSGi Configuration in AEM

create a similar JSON file under different environments like

  2. config.stage

and update the config values as per the environments.



Mayur Satav

Hello! welcome to my homepage! My name is Mayur Satav and I am a Senior Developer. I am an accomplished coder and programmer. Visit