Hi, all,
my project has two component, class A needs thrift 0.9, and class B needs thrift 0.7. A and B are in one project and share one top level pom file. B pull the thrift 0.7 as a transitive dependency , so I need to pull thrift 0.9 for A explicitly.
I am doing below to re-package thrift 0.9 for A, so other classes will not get it.
I don't quite understand what is tag <keep> for ?
My understand is use <include> to grab the maven dependencies I want to re-package, then use <pattern> and <result> in <rule> to define what class to re-package and what's the new name for re-packaged binary.
And use <keep> to indicate which class in the project will only use this re-packaged dependencies, in my case, it is project A. Am I right ?
below pom doesn't work for me, and class A, B still share the same thrift 0.9. Thrift 0.7 is omitted.
Thanks a lot for help,
Johnny
<dependency>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
<version>0.9.0</version>
</dependency>
......
......
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>jarjar-maven-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jarjar</goal>
</goals>
<configuration>
<includes>
<include>org.apache.thrift:libthrift</include>
</includes>
<rules>
<rule>
<pattern>org.apache.thrift.**</pattern>
<result>com.google.inject.internal.internal.thrift.@1</result>
</rule>
<keep>
<pattern>com.class.A.pattern.**</pattern>
</keep>
</rules>
</configuration>
</execution>
</executions>
</plugin>