March 20, 2020
Estimated Post Reading Time ~

How to compile 3rd party bundles Locally which are not available in public repository.

Some times we may need some of the bundles latest version which is available in AEM but the same version is not available in the Maven public repository or Adobe nexus repository. Here we will see how to get the bundle locally and compile it. 



First Step - if the third party bundle is in your local AEM server,
Getting bundle from AEM and install it in our local maven repository-
When you notice a bundle is available in the AEM servers system >console >bundle, the AEM Install folder will have the same bundle in the disk.

First of all, you identify the bundle id from AEM system console as shown below.
To find the same bundle in local disk, go to
AEM Installed folder\crx-quickstart\launchpad\felix\bundle<id>)

Now copy this bundle to a location (for e.g C:)

Second Step: Next step is installing it in our local maven repository. Open the command prompt in c:

The syntax for installing the bundle in local repository is
mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>

Actual command used:
mvn install:install-file -Dfile=bundle.jar -DgroupId=org.apache.jackrabbit -DartifactId=jackrabbit-api -Dversion=2.18.0 -Dpackaging=jar

Now you will have the dependency bundle in your local maven repository and your code will compile without issues.


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.