public
Created

Add this Maven shader plugin in the Unirest-java pom.xml to work around dependency errors when using Unirest in your Android projects

  • Download Gist
unirestjavamavenshader.xml
XML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<finalName>${project.artifactId}-${project.version}-withDependency-ShadedForAndroid</finalName>
<artifactSet>
<includes>
<include>com.mashape.unirest:unirest-java</include>
<include>org.apache.httpcomponents:httpclient</include>
<include>org.apache.httpcomponents:httpcore</include>
<include>org.apache.httpcomponents:httpcore-nio</include>
<include>org.apache.httpcomponents:httpasyncclient</include>
<include>org.apache.httpcomponents:httpmime</include>
<include>org.json:json</include>
<include>commons-logging:commons-logging</include>
<include>commons-codec:commons-codec</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>org.apache.http</pattern>
<shadedPattern>com.mashape.relocation</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.