Skip to main content
Nov 29, 2023 4:22 PM UTC
Solved

Apache Batik dependency not resolved

Hello everyone, 

i'm creating a servlet that converts a SVG image to a PNG with Apache Batik.

In my core/pom.xml i have the following dependency:

 

<dependency> <groupId>org.apache.xmlgraphics</groupId> <artifactId>batik-all</artifactId> <version>1.17</version> </dependency>

 

I can compile (and also run locally in a main function) the code but I'm getting the following error when installing the bundle on AEM:

 

org.apache.batik.gvt.renderer -- Cannot be resolved org.apache.batik.transcoder -- Cannot be resolved org.apache.batik.transcoder.image -- Cannot be resolved

 

How can I fix this? 

For context, I'm using Java 8 and AEM 6.5.9.

Thank you for your replies.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Sudheer_Sundalam
Sudheer_SundalamAccepted solution
Community Advisor
Nov 29, 2023 5:42 PM UTC

@antoniomartino ,

 

Please follow this blog and see how to embed the dependency in you maven project.

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

6 replies

Sudheer_Sundalam
Community Advisor
Sudheer_SundalamCommunity AdvisorAccepted solution
Community Advisor
Nov 29, 2023 5:42 PM UTC

@antoniomartino ,

 

Please follow this blog and see how to embed the dependency in you maven project.

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

Translate
Nov 30, 2023 8:47 AM UTC

So, i followed the blog's article but, since i'm using bnd-maven-plugin the article itself linked this page:https://myaemlearnings.blogspot.com/2021/12/embed-third-party-dependency-using-bnd.htm from the same site.

 

I used the first approach (the one with -conditionalpackage) and my plugin now looks like this:

<plugin> <groupId>biz.aQute.bnd</groupId> <artifactId>bnd-maven-plugin</artifactId> <executions> <execution> <id>bnd-process</id> <goals> <goal>bnd-process</goal> </goals> <configuration> <bnd> <![CDATA[ Import-Package: javax.annotation;version=0.0.0,* -conditionalpackage: com.apache.xmlgraphics.* ]]> </bnd> </configuration> </execution> </executions> </plugin>

Unfortunately, this did not solve the issue.

Translate
Mahedi_Sabuj
Community Advisor
Community Advisor
Nov 30, 2023 10:02 AM UTC

Hi @antoniomartino, You need to make the change on parent pom.xml.

Translate
Mahedi Sabuj
DPrakashRaj
Community Advisor
Community Advisor
Nov 29, 2023 6:23 PM UTC

Are you referring that maven build is able to compile the build and once deployed on aem you are seeing the above error?

Translate
Nov 30, 2023 8:47 AM UTC

Yes. 

This is what is happening.

Translate
arunpatidar
Community Advisor
Community Advisor
Nov 30, 2023 10:46 AM UTC

Hi @antoniomartino 
Could you please check if below is JAR or Bundle?

https://mvnrepository.com/artifact/org.apache.xmlgraphics/batik-all/1.17

Translate
Arun Patidar