Expand my Community achievements bar.

SOLVED

Apache Batik dependency not resolved

Avatar

Level 1

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.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@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

View solution in original post

6 Replies

Avatar

Correct answer by
Community Advisor

@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

Avatar

Level 1

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.

Avatar

Community Advisor

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

Avatar

Community Advisor

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