Expand my Community achievements bar.

SOLVED

Installing iText PDF in AEM 6.5.18

Avatar

Level 4

I've added the following to my pom.xml, however it's not getting deployed to my local instance of AEM author. 

 

            <!-- iTextPDF -->
            <dependency>
                <groupId>com.itextpdf</groupId>
                <artifactId>itextpdf</artifactId>
                <version>5.5.13.3</version>
                <scope>provided</scope>
            </dependency>

 

 

I have to manually install the jar file in bundles for it to work. Is there another workaround? Thanks.

 

stiegjo22_0-1709670018643.png

 

1 Accepted Solution

Avatar

Correct answer by
Level 6

@stiegjo22 

Try creating new module similar to core in your maven project and include dependencies in it.

Here we need to create an OSGi bundle out of third party non-osgi dependency using maven-bundle-plugin

After deploying you will see a new bundle called commons.core

Below article mentions all the steps for it

https://myaemlearnings.blogspot.com/2021/08/embedding-third-party-dependencyosgi.html

View solution in original post

2 Replies

Avatar

Correct answer by
Level 6

@stiegjo22 

Try creating new module similar to core in your maven project and include dependencies in it.

Here we need to create an OSGi bundle out of third party non-osgi dependency using maven-bundle-plugin

After deploying you will see a new bundle called commons.core

Below article mentions all the steps for it

https://myaemlearnings.blogspot.com/2021/08/embedding-third-party-dependencyosgi.html

Avatar

Level 4

Hi @stiegjo22 

 

If you want to include the itextpdf library in your bundle automatically, remove the <scope>provided</scope> bit so that itextpdf gets embedded into your bundle when you build the project. Like below:

 

<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>5.5.13.3</version>
</dependency>

 

Also, examine the Import-Package configuration in your Maven Bundle plugin configuration. If the com.itextpdf packages are set to version="[0,1)", then it will try to resolve the iText packages from AEM rather than embedding them.

 

Thanks,

Venkat