Friday, 26 January 2018

AEM Run mode configuration using OSGI R6 annotations

In my previous project I tried to migrate run mode configuration written using scr annotations to OSGI R6 annotations. Unfortunately I couldn't find anything useful for me in the internet as most of the articles were describing only about normal configuration migration. As I am not an expert I couldn't easily find a solution to do that by referring those articles. In this blog I am writing on how I have achieved that.

This is not a step by step tutorial. I am not good at writing those. This post only help those who already know about OSGI run mode configurations and have implemented those using SCR annotations. This may guide those who are facing challenges while migrating. My github link only contains the OSGI service and its implementation. Building that gives you a jar which can be deployed directly using the AEM system/console/bundles interface(As I mentioned earlier this is not a project, just a sample code to guide). Please go through the Adobe documentation
https://helpx.adobe.com/experience-manager/using/osgi_config.html. I was trying to implement the same thing using OSGI R6 annotations as SCR annotations they are using in the documentation is now deprecated. Apart from the Java code part where the OSGI service is implemented you can refer the rest of the article to implement this.

This is my github link to the code sample. https://github.com/thatsmeadarsh/aem-osgiR6-annotaion-runmode-conf-demo