ilsu lee
ilsu lee

Reputation: 3

AEM, Maven : duplicated package name

I want to add "fop-core" dependency.
My project was added "uber-jar" dependency already.

The uber-jar dependency has org.apache.fop.apps.FopFactory.java file.
But, doesn't have org.apache.fop.apps.FopFactoryBuilder.java file.

The fop-core dependency has both FopFactory.java and FopFactoryBuilder.java files.

Thus, my program loads FopFactory.java in "uber-jar" instead of "fop-core".

How can I resolve this duplication??

  1. Can I remove "FopFactory.java" file in "uber-jar" dependency?

OR

  1. Can I force load "FopFactory.java" file in "fop-core" dependency?

uber-jar

    <groupId>com.adobe.aem</groupId>
    <artifactId>uber-jar</artifactId>
    <classifier>apis</classifier>
</dependency>

fop-core

<dependency>
    <groupId>org.apache.xmlgraphics</groupId>
    <artifactId>fop-core</artifactId>
    <version>2.5</version>
</dependency>

Upvotes: 0

Views: 266

Answers (2)

ronnyfm
ronnyfm

Reputation: 2081

Echoing Oliver Gebert response, I did that a few months ago for Apache POI, in the main pom.xml, I put it as the first dependency:

    <dependencyManagement>
    <dependencies>
        <!-- Apache POI (First in order to avoid conflict with the version from the UberJar) -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>3.11</version>
        </dependency>

Upvotes: 0

Oliver Gebert
Oliver Gebert

Reputation: 1176

Make sure that the fop-core dependency is coming first in your pom. That should do the trick.

HTH, OliG

Upvotes: 1

Related Questions