Demonstrates OSGi Declarative Services Annotations along side Felix SCR Annotations.
Switch branches/tags
Nothing to show
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
core Add spaces May 26, 2017
.gitignore initial commit May 25, 2017
LICENSE initial commit May 25, 2017
NOTICE initial commit May 25, 2017 Add blog link to README May 26, 2017
pom.xml initial commit May 25, 2017

AEM OSGi Declarative Services Annotations

This project demonstrates the basics of using the OSGi Declarative Services annotations along side the more familiar Felix SCR annotations.

Examples are given for both annotation styles in each of a servlet, service, filter, scheduler and an event handler / listener. These five examples are common AEM project requirements and the examples can be extrapolated out for anything else such as MBeans, Adapters, Workflow Process Steps, Replication Preprocessors, etc...

Note the service example creates the Configuration as a separate class while the other examples create the Configuration as a subclass.

View the associated blog post at

How to build

This project has been built and tested in AEM 6.2.

To build all the modules run in the project root directory the following command with Maven 3:

mvn clean install

Or to deploy the bundle to the author, run

mvn clean install -PautoInstallBundle


Below are a some cURL commands to help you test the components. Navigate to the Felix Configuration console to update component properties.

Servlets and Services

Make a GET request to the servlets which consume the services and respond back with plain text:

curl -u admin:admin http://localhost:4502/bin/felix
curl -u admin:admin http://localhost:4502/bin/osgi

Event Handler

Create a new node under /content and watch the logs:

curl -u admin:admin http://localhost:4502/content/foo -F"myproperty=bar"


View the logs to see the scheduler running every 60 seconds by default.


Make a request to a resouce under /content and watch the logs:

curl -u admin:admin http://localhost:4502/content/geometrixx/en/products/triangle.html

Maven settings

The project comes with the auto-public repository configured. To setup the repository in your Maven settings, refer to: