Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Embedding third party jar into bundle


Level 5


I am using one servlet with import or reference to one API in the jar.I have added jar file as external jar in my eclipse but I am getting build error.

"package com.mypackage.api.config does not exist"

Please suggest how to add jar dependency in my servlet

3 Replies


Level 5

Hi ,

I got the answer for my query, added dependency in my pom.xml and created one lib folder and added my jar file in it.









Level 10

Another way is to wrap the 3rd pary JAR into an OSGi bundle and deploy.  You can use Eclipse plug-in project for that purpose. 

See how we handle Simple JSON JAR in this community article/video:


Level 10

Ok - i think you mean when the 3rd party JAR is custom and not in the Maven repository. In that case...

You can place the JAR in your local Maven Repository and then reference it in your POM file. For example, to resolve myCustomJAR_1.0.0.jar within an AEM service, the myCustomJAR_1.0.0.jar file must be located in the Maven repository. You can upload the myCustomJAR_1.0.0.jar to Maven by using this Maven command: 

mvn install:install-file -Dfile=C:/plugins/myCustomJAR_1.0.0.jar -DartifactId=jrurbersrt1.0 -Dversion=1.0 -Dpackaging=jar -DgeneratePom=true

Notice that you must specify the location of the myCustomJAR file in the -Dfile argument. Also notice that you specify the Dgroup and DartifactID values. Once you upload the JAR to Maven using this command, you can reference this JAR file using this Dependency.


Notice that scope element is system and systemPath references the location of the JAR file in the repository. (This dependency is used later in this article to build the AEM service)