This OSGi Bundle turn AEM into a maven repository and provides developers access to all OSGi bundles running in Apache Felix inside the Adobe Experience Manager.
- AEM 6.1
Even when this plugin isn't tested on AEM 6.0 or AEM 5.x, it's quite possible that it works fine with these versions. Please open a ticket on GitHub when you tested it, so I can extend the compatibility list.
- Download the latest aem-maven-repository jar file from https://github.com/sbrinkmann/aem-maven-repository/releases
- Go to the Apache Felix Console http://:<4502|4503>/system/console/bundles
- Select Install or Update
- Select the just downloaded aem-maven-repository jar file with the file picker
- Tick the Start Bundle checkbox
- Hit Install or Update button to finish the deployment
The AEM Maven Repository provides two web interfaces. The first one generates a POM file which represents all OSGi bundles running inside Apache Felix. The second provides access as a Maven repository.
- Quick Access
http://localhost:4502/bin/maven/dependencies.xml - Access the List of Dependencies Only
http://localhost:4502/bin/maven/dependencies.xml?dependenciesOnly=true - Adjust group ID, artifact ID and version number (e.g. my.group.id:aem-base:6.1)
http://localhost:4502/bin/maven/dependencies.xml?groupId=my.group.id&artifactId=aem-base&version=6.1
Add the following part to your POM file. Adjust the in case your instance doesn't run on localhost or another port.
<repositories>
<repository>
<id>aem-repository</id>
<name>AEM Maven Repository</name>
<url>http://localhost:4502/bin/maven/repository</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>aem-repository</id>
<name>AEM Maven Repository</name>
<url>http://localhost:4502/bin/maven/repository</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
Adjust the password, in case changed the admin password
<server>
<id>aem-repository</id>
<username>admin</username>
<password>admin</password>
</server>
Build
mvn clean install
Build and Deploy
mvn -Pinstall-bundle clean install
Build and Deploy to another instance then localhost:4502 with the credentials admin:admin
mvn -Pinstall-bundle -Dcq.host=localhost -Dcq.port=4502 -Dcq.user=admin -Dcq.password=admin clean install