[GRIFFIN-291] Relocate HttpClient code in measure jar using shade plugin
Now projects use different version of httpclient , and very easy to have conflicts with other components.
We can shade the httpclient sources into measure jar and the conflicts disappear.
Author: wankunde <wankunde@163.com>
Closes #535 from wankunde/httpclient.
diff --git a/measure/pom.xml b/measure/pom.xml
index c68cdd7..7f9f1f1 100644
--- a/measure/pom.xml
+++ b/measure/pom.xml
@@ -234,20 +234,39 @@
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
- <artifactId>maven-assembly-plugin</artifactId>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <version>3.1.0</version>
<configuration>
- <descriptorRefs>
- <descriptorRef>jar-with-dependencies</descriptorRef>
- </descriptorRefs>
- <appendAssemblyId>false</appendAssemblyId>
+ <createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
<executions>
<execution>
- <id>make-assembly</id>
<phase>package</phase>
<goals>
- <goal>single</goal>
+ <goal>shade</goal>
</goals>
+ <configuration>
+ <transformers>
+ <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+ <mainClass>org.apache.griffin.measure.Application</mainClass>
+ </transformer>
+ </transformers>
+ <relocations>
+ <relocation>
+ <pattern>org.apache.http</pattern>
+ <shadedPattern>griffin.org.apache.http</shadedPattern>
+ </relocation>
+ </relocations>
+ <filters>
+ <filter>
+ <artifact>*:*</artifact>
+ <excludes>
+ <exclude>META-INF/maven/**</exclude>
+ </excludes>
+ </filter>
+ </filters>
+ </configuration>
</execution>
</executions>
</plugin>