AEM Handbook
AEM Handbook
AEM Handbook
In some business use cases, you create an OSGi bundle when creating an
Adobe Experience Manager (AEM) application. Although there are
different ways to create an OSGi bundle, a recommended way is to use
Maven and the Adobe Maven Archetype. This development article walks
you through creating a basic OSGi bundle that contains a simple service
named KeyService. All this service does is accept an input value and sets
a key value. It also exposes a method that returns the key value and the
value can be displayed within an AEM web page.
0
AEM HANDBOOK : CKJ
1
AEM HANDBOOK : CKJ
4. Enter the folder name into the Create Folder dialog box.
Enter firstOSGI.
5. Repeat steps 1-4 for each folder specified in the previous
illustration.
6. Click the Save All button.
2
AEM HANDBOOK : CKJ
mvn
org.apache.maven.plugins:maven-archetype-plugin:2.4:generate // creates
a Maven project from an archetype: asks the user to choose an archetype
from the archetype catalog, and retrieves it from the remote repository.
Once retrieved, it is processed to create a working Maven project.
-DarchetypeGroupId=com.adobe.granite.archetypes //The archetype's
groupId
-DarchetypeArtifactId=aem-project-archetype // archetype's artifactId.
-DarchetypeVersion=11 // The archetype's version
3
AEM HANDBOOK : CKJ
-DarchetypeCatalog=https://repo.adobe.com/nexus/content/groups/public/ //archetype
catalogs to use to build a list and let the user choose from. It is a comma
separated list of catalogs. Catalogs use the following schemes:
'remote' which is the shortcut for Maven Central repository or its mirror
If you want the catalogs to come from a different repository, please add the
following to your settings.xml
<repository>
<id>archetype</id>
<url>https://repository.domain.com/path/to/repo/</url>
</repository>