I'm trying to relocate the packages from "com.fasterxml.jackson" into my own package (ie, "mypackage.com.fasterxml.jackson") and then consume it in another JAR which I own.
I've managed to run the maven-shade plugin to do it using this configuration:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>false</shadedArtifactAttached>
<createDependencyReducedPom>true</createDependencyReducedPom>
<relocations>
<relocation>
<pattern>com.fasterxml.jackson</pattern>
<shadedPattern>mypackage.com.fasterxml.jackson</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
The problem that I'm facing is when I try to consume it, from some reason Eclipse keeps adding a dependency to the original jackson ("mypackage.com.fasterxml.jackson") and not the new one.
Just to be clear, my setup is: - Jar X have a dependency in ThirdPartyArtifcats. - ThirdPartyArtifcats references Jackson and run the maven-shade plugin, thus it contains a modified version of Jackson (mypackage.com.fasterxml.jackson).
When I try to use Jackson's ObjectMapper in Jar X, Eclipse keeps giving a reference to the original jackson.
I'll appreciate your help!