Relocate libraries correctly (Related #467)
This commit is contained in:
parent
ea93a336c3
commit
c28a6922c0
82
pom.xml
82
pom.xml
@ -138,13 +138,34 @@
|
|||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
<!--Relocate all lib we use in order to fix class loading errors if we use different versions
|
||||||
|
than already loaded libs (i.e. by Mojang -> gson)-->
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
<version>2.4.3</version>
|
<version>2.4.3</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||||
<minimizeJar>false</minimizeJar>
|
<minimizeJar>false</minimizeJar>´
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>spigot-shade</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>shade</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<artifactSet>
|
||||||
|
<excludes>
|
||||||
|
<exclude>com.google.guava:guava</exclude>
|
||||||
|
</excludes>
|
||||||
|
</artifactSet>
|
||||||
<relocations>
|
<relocations>
|
||||||
|
<!--We use a newer version of gson so include it to the jar and reference to the new version-->
|
||||||
|
<relocation>
|
||||||
|
<pattern>com.google.gson</pattern>
|
||||||
|
<shadedPattern>fr.xephi.authme.libs.google</shadedPattern>
|
||||||
|
</relocation>
|
||||||
<relocation>
|
<relocation>
|
||||||
<pattern>org.mcstats</pattern>
|
<pattern>org.mcstats</pattern>
|
||||||
<shadedPattern>fr.xephi.authme</shadedPattern>
|
<shadedPattern>fr.xephi.authme</shadedPattern>
|
||||||
@ -181,25 +202,7 @@
|
|||||||
<pattern>net.ricecode.similarity</pattern>
|
<pattern>net.ricecode.similarity</pattern>
|
||||||
<shadedPattern>fr.xephi.authme.libs.similarity</shadedPattern>
|
<shadedPattern>fr.xephi.authme.libs.similarity</shadedPattern>
|
||||||
</relocation>
|
</relocation>
|
||||||
<relocation>
|
|
||||||
<pattern>com.google.gson</pattern>
|
|
||||||
<shadedPattern>fr.xephi.authme.libs.google.gson</shadedPattern>
|
|
||||||
</relocation>
|
|
||||||
</relocations>
|
</relocations>
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>spigot-shade</id>
|
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>shade</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<artifactSet>
|
|
||||||
<excludes>
|
|
||||||
<exclude>com.google.guava:guava</exclude>
|
|
||||||
</excludes>
|
|
||||||
</artifactSet>
|
|
||||||
<outputFile>target/${jarName}-spigot.jar</outputFile>
|
<outputFile>target/${jarName}-spigot.jar</outputFile>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
@ -210,14 +213,47 @@
|
|||||||
<goal>shade</goal>
|
<goal>shade</goal>
|
||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<!--Include all google libraries, because they are not avaialbe before 1.8-->
|
||||||
<relocations>
|
<relocations>
|
||||||
<relocation>
|
<relocation>
|
||||||
<pattern>com.google.thirdparty</pattern>
|
<pattern>com.google</pattern>
|
||||||
<shadedPattern>fr.xephi.authme.libs.google.thirdparty</shadedPattern>
|
<shadedPattern>fr.xephi.authme.libs.google</shadedPattern>
|
||||||
</relocation>
|
</relocation>
|
||||||
<relocation>
|
<relocation>
|
||||||
<pattern>com.google.commons</pattern>
|
<pattern>org.mcstats</pattern>
|
||||||
<shadedPattern>fr.xephi.authme.libs.google.commons</shadedPattern>
|
<shadedPattern>fr.xephi.authme</shadedPattern>
|
||||||
|
</relocation>
|
||||||
|
<relocation>
|
||||||
|
<pattern>org.apache</pattern>
|
||||||
|
<shadedPattern>fr.xephi.authme.libs.apache</shadedPattern>
|
||||||
|
</relocation>
|
||||||
|
<relocation>
|
||||||
|
<pattern>javax.mail</pattern>
|
||||||
|
<shadedPattern>fr.xephi.authme.libs.javax.mail</shadedPattern>
|
||||||
|
</relocation>
|
||||||
|
<relocation>
|
||||||
|
<pattern>javax.activation</pattern>
|
||||||
|
<shadedPattern>fr.xephi.authme.libs.javax.activation</shadedPattern>
|
||||||
|
</relocation>
|
||||||
|
<relocation>
|
||||||
|
<pattern>com.sun</pattern>
|
||||||
|
<shadedPattern>fr.xephi.authme.libs.sun</shadedPattern>
|
||||||
|
</relocation>
|
||||||
|
<relocation>
|
||||||
|
<pattern>com.zaxxer.hikari</pattern>
|
||||||
|
<shadedPattern>fr.xephi.authme.libs.hikari</shadedPattern>
|
||||||
|
</relocation>
|
||||||
|
<relocation>
|
||||||
|
<pattern>org.slf4j</pattern>
|
||||||
|
<shadedPattern>fr.xephi.authme.libs.slf4j</shadedPattern>
|
||||||
|
</relocation>
|
||||||
|
<relocation>
|
||||||
|
<pattern>com.maxmind.geoip</pattern>
|
||||||
|
<shadedPattern>fr.xephi.authme.libs.geoip</shadedPattern>
|
||||||
|
</relocation>
|
||||||
|
<relocation>
|
||||||
|
<pattern>net.ricecode.similarity</pattern>
|
||||||
|
<shadedPattern>fr.xephi.authme.libs.similarity</shadedPattern>
|
||||||
</relocation>
|
</relocation>
|
||||||
</relocations>
|
</relocations>
|
||||||
<outputFile>target/${jarName}-legacy.jar</outputFile>
|
<outputFile>target/${jarName}-legacy.jar</outputFile>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user