Skip to content

Instantly share code, notes, and snippets.

@ismaelc
Created December 10, 2013 23:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ismaelc/7902578 to your computer and use it in GitHub Desktop.
Save ismaelc/7902578 to your computer and use it in GitHub Desktop.
Add this Maven shader plugin in the Unirest-java pom.xml to work around dependency errors when using Unirest in your Android projects
<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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment