Apache Batik dependency not resolved | Community
Skip to main content
November 29, 2023
Solved

Apache Batik dependency not resolved

  • November 29, 2023
  • 3 replies
  • 2586 views

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.
Best answer by Sudheer_Sundalam

@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

3 replies

Sudheer_Sundalam
Community Advisor
Sudheer_SundalamCommunity AdvisorAccepted solution
Community Advisor
November 29, 2023

@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

November 30, 2023

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.

Mahedi_Sabuj
Community Advisor
Community Advisor
November 30, 2023

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

Mahedi Sabuj
DPrakashRaj
Community Advisor
Community Advisor
November 29, 2023

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

November 30, 2023

Yes. 

This is what is happening.

arunpatidar
Community Advisor
Community Advisor
November 30, 2023
Arun Patidar