Highlighted

How to create Osgi bundle in AEM 6.4

yash558824

17-09-2018

Hello friend

I am new to AEM and trying to create a OSGi bundle so i found 2 ways to do it

1. Crx/de

2. Maven command.

and follow links below :

Adobe Experience Manager Help | Creating OSGi bundles for the Adobe Digital Marketing Suite using CRXDE

Adobe Experience Manager Help | Creating your first Adobe Experience Manager Service using an Maven Archetype project

Respectively for crx/de and maven .

so as far as i have researched we cannot create bundle in 6.4 using Crx/de(please tell me if we can?) so now when i am following the second way using maven i am stuck on the step four which is creation of project using command and i am using the following command :

mvn archetype:generate

-DarchetypeRepository=http://repo.adobe.com/nexus/content/groups/public/

-DarchetypeGroupId=com.day.jcr.vault

-DarchetypeArtifactId=multimodule-content-package-archetype

-DarchetypeVersion=1.0.2

-DgroupId=com.adobe.cq

-DartifactId=key61

-Dversion=1.0-SNAPSHOT

-Dpackage=com.adobe.cq

-DappsFolderName=myproject

-DartifactName="My Project"

-DcqVersion="6.4"

-DpackageGroup="My Company"

Also i am not sure about the setting.xml which they are coping to the user profile in step 3, That what is the use of doing it ?

Please help on this.

Thanks in Advance

Replies

Highlighted

Arun_Patidar

MVP

18-09-2018

Hi,

Please check

Creating an Adobe Experience Manager 6.4 Project using Adobe Maven Archetype 13

settings.xml is used to do global changes for maven similar like POM.xml

In above tutorials adobe public repo is added to download dependencies hosted to adobe public repo instead of maven repo.

Highlighted

yash558824

18-09-2018

Thanks for the reply.

But in the above tutorial if you see there are two folder which are getting created i.e. content and bundle but in our case of AEM 6.4 i am getting 5 folders core, test, content, app and launcher,

so where i have to write the code for keyservice interface and keyserviceImpl.

Highlighted

Veena_Vikram

MVP

18-09-2018

HI Yash

   The correct way to create an AEM project is to use either Maven or Lazybones. Since you are starting with the AEM development , I would recoomend you to go with Maven. You can follow the link Arun mentioned.Now to answer your question specifically , when you create a project using Maven command , it actually create an initial structure for you. Depending on the archetype you are using it will generate the folder structures for you. So when you create your initial project , you will have a structure something like below

1573923_pastedImage_0.png

To brief you

core - all your backend code will be inside this folder

it.launcher - Your AEM integration tests can go here

it.tests - Integration tests

ui.apps - this will have the components , (In simple words your apps)

ui.content - this can have content, conf and anything which facilitate content

        All your java coding should go inside your core folder. When you import your maven project to eclipse , it will have a structure similar to below.

1573924_pastedImage_2.png and all the java coding will go inside , in this case , utilities.core .

1573937_pastedImage_3.png  also , since you are starting with AEM development,. your initial code base will have a set of sample code for you to understand different modules like servlets , services, schedulers so and so. 

If you need more info , please let us know. Happy coding . And welcome to AEM world 

Thanks

Veena

Highlighted

smacdonald2008

18-09-2018

In AEM 6.x - never use CRXDE lite to create OSGi bundles. Always use a Maven Archetype.

Creating an Adobe Experience Manager 6.4 Project using Adobe Maven Archetype 13

Also - as you are new to AEM -- see Getting Started with AEM-Sites

Please start with this article too -- Getting Started with AEM Sites - WKND Tutorial (This will teach you how to really get up and running with AEM)

Highlighted

smacdonald2008

18-09-2018

Also when you use HELPX articles - please refer to the version.

One of the issues you have is you are trying to use an article meant for AEM 5.5 on 6.4. See below. Always match the article version with the AEM version.

OSGi.png

Highlighted

yash558824

19-09-2018

Hello friend

By the help of your resources i have created a project and has the bundle in my web console under osgi> bundle.

but now i want to see how two component communicate with each other,

so what should be the steps to check that.

Please help

Thanks in advance