diff --git a/bukkit/pom.xml b/bukkit/pom.xml
index 578929283..400642c5b 100644
--- a/bukkit/pom.xml
+++ b/bukkit/pom.xml
@@ -50,10 +50,6 @@
net.kyori.text
me.lucko.luckperms.lib.text
-
- me.lucko.jarrelocator
- me.lucko.luckperms.lib.jarrelocator
-
@@ -93,9 +89,13 @@
me.lucko.luckperms.lib.bson
- redis.clients.jedis.shaded
+ redis.clients.jedis
me.lucko.luckperms.lib.jedis
+
+ org.apache.commons.pool2
+ me.lucko.luckperms.lib.commonspool2
+
ninja.leaping.configurate
me.lucko.luckperms.lib.configurate
diff --git a/bungee/pom.xml b/bungee/pom.xml
index 23d93dce4..197e8e820 100644
--- a/bungee/pom.xml
+++ b/bungee/pom.xml
@@ -50,10 +50,6 @@
net.kyori.text
me.lucko.luckperms.lib.text
-
- me.lucko.jarrelocator
- me.lucko.luckperms.lib.jarrelocator
-
@@ -93,9 +89,13 @@
me.lucko.luckperms.lib.bson
- redis.clients.jedis.shaded
+ redis.clients.jedis
me.lucko.luckperms.lib.jedis
+
+ org.apache.commons.pool2
+ me.lucko.luckperms.lib.commonspool2
+
ninja.leaping.configurate
me.lucko.luckperms.lib.configurate
diff --git a/common/pom.xml b/common/pom.xml
index 929ad5f45..754853517 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -44,24 +44,6 @@
provided
-
-
- me.lucko
- jar-relocator
- 1.2
- compile
-
-
- org.ow2.asm
- asm
-
-
- org.ow2.asm
- asm-commons
-
-
-
-
net.kyori
@@ -101,7 +83,7 @@
com.google.guava
guava
19.0
- provided
+ compile
@@ -169,7 +151,7 @@
redis.clients
jedis
- 2.9.1-shaded
+ 2.9.0
provided
diff --git a/common/src/main/java/me/lucko/luckperms/common/dependencies/Dependency.java b/common/src/main/java/me/lucko/luckperms/common/dependencies/Dependency.java
index c89299a09..3705963da 100644
--- a/common/src/main/java/me/lucko/luckperms/common/dependencies/Dependency.java
+++ b/common/src/main/java/me/lucko/luckperms/common/dependencies/Dependency.java
@@ -28,8 +28,7 @@ package me.lucko.luckperms.common.dependencies;
import com.google.common.collect.ImmutableList;
import com.google.common.io.ByteStreams;
-import me.lucko.jarrelocator.Relocation;
-import me.lucko.luckperms.common.dependencies.relocation.Relocations;
+import me.lucko.luckperms.common.dependencies.relocation.Relocation;
import java.io.InputStream;
import java.net.URL;
@@ -53,55 +52,61 @@ public enum Dependency {
"5.2",
"zBMYiX4sdxy3l6aNX06mQcI6UfBDfKUXq+z5ZN2yZAs="
),
+ JAR_RELOCATOR(
+ "me.lucko",
+ "jar-relocator",
+ "1.2",
+ "ECR0wrAMwmM0dpmuY1ifCG+2rpObOIlSI127jBbSrbI="
+ ),
CAFFEINE(
"com{}github{}ben-manes{}caffeine",
"caffeine",
"2.6.0",
"JmT16VQnCnVBAjRJCQkkkjmSVx2jajpzeBuKwpbzDA8=",
- Relocations.of("caffeine", "com{}github{}benmanes{}caffeine")
+ Relocation.of("caffeine", "com{}github{}benmanes{}caffeine")
),
MARIADB_DRIVER(
"org{}mariadb{}jdbc",
"mariadb-java-client",
"2.2.0",
"/q0LPGHrp3L9rvKr7TuA6urbtXBqvXis92mP4KhxzUw=",
- Relocations.of("mariadb", "org{}mariadb{}jdbc")
+ Relocation.of("mariadb", "org{}mariadb{}jdbc")
),
MYSQL_DRIVER(
"mysql",
"mysql-connector-java",
"5.1.44",
"d4RZVzTeWpoHBPB/tQP3mSafNy7L9MDUSOt4Ku9LGCc=",
- Relocations.of("mysql", "com{}mysql")
+ Relocation.of("mysql", "com{}mysql")
),
POSTGRESQL_DRIVER(
"org{}postgresql",
"postgresql",
"9.4.1212",
"DLKhWL4xrPIY4KThjI89usaKO8NIBkaHc/xECUsMNl0=",
- Relocations.of("postgresql", "org{}postgresql")
+ Relocation.of("postgresql", "org{}postgresql")
),
H2_DRIVER(
"com.h2database",
"h2",
"1.4.196",
"CgX0oNW4WEAUiq3OY6QjtdPDbvRHVjibT6rQjScz+vU=",
- Relocations.of("h2", "org{}h2")
+ Relocation.of("h2", "org{}h2")
),
SQLITE_DRIVER(
"org.xerial",
"sqlite-jdbc",
"3.21.0",
"bglRaH4Y+vQFZV7TfOdsVLO3rJpauJ+IwjuRULAb45Y=",
- Relocations.of("sqlite", "org{}sqlite")
+ Relocation.of("sqlite", "org{}sqlite")
),
HIKARI(
"com{}zaxxer",
"HikariCP",
"2.7.4",
"y9JE6/VmbydCqlV1z468+oqdkBswBk6aw+ECT178AT4=",
- Relocations.of("hikari", "com{}zaxxer{}hikari")
+ Relocation.of("hikari", "com{}zaxxer{}hikari")
),
SLF4J_SIMPLE(
"org.slf4j",
@@ -121,36 +126,47 @@ public enum Dependency {
"3.5.0",
"gxrbKVSI/xM6r+6uL7g7I0DzNV+hlNTtfw4UL13XdK8=",
ImmutableList.builder()
- .addAll(Relocations.of("mongodb", "com{}mongodb"))
- .addAll(Relocations.of("bson", "org{}bson"))
+ .addAll(Relocation.of("mongodb", "com{}mongodb"))
+ .addAll(Relocation.of("bson", "org{}bson"))
.build()
),
JEDIS(
- "https://github.com/lucko/jedis/releases/download/jedis-2.9.1-shaded/jedis-2.9.1-shaded.jar",
- "2.9.1-shaded",
- "mM19X6LyD97KP4RSbcCR5BTRAwQ0x9y02voX7ePOSjE=",
- Relocations.of("jedis", "redis{}clients{}jedis{}shaded")
+ "redis.clients",
+ "jedis",
+ "2.9.0",
+ "HqqWy45QVeTVF0Z/DzsrPLvGKn2dHotqI8YX7GDThvo=",
+ ImmutableList.builder()
+ .addAll(Relocation.of("jedis", "redis{}clients{}jedis"))
+ .addAll(Relocation.of("commonspool2", "org{}apache{}commons{}pool2"))
+ .build()
+ ),
+ COMMONS_POOL_2(
+ "org.apache.commons",
+ "commons-pool2",
+ "2.4.2",
+ "IREqpnNzPfzQRTVN33WzHh1GS5nI5RWXQ0myUyJUzFM=",
+ Relocation.of("commonspool2", "org{}apache{}commons{}pool2")
),
CONFIGURATE_CORE(
"ninja{}leaping{}configurate",
"configurate-core",
"3.3",
"4leBJEqj1kVszaifZeKNl4hgHxG5M+Nk5TJKkPW2s4Y=",
- Relocations.of("configurate", "ninja{}leaping{}configurate")
+ Relocation.of("configurate", "ninja{}leaping{}configurate")
),
CONFIGURATE_GSON(
"ninja{}leaping{}configurate",
"configurate-gson",
"3.3",
"4HxrW3/ZKdn095x/W4gylQMNskdmteXYVxVv0UKGJA4=",
- Relocations.of("configurate", "ninja{}leaping{}configurate")
+ Relocation.of("configurate", "ninja{}leaping{}configurate")
),
CONFIGURATE_YAML(
"ninja{}leaping{}configurate",
"configurate-yaml",
"3.3",
"hgADp3g+xHHPD34bAuxMWtB+OQ718Tlw69jVp2KPJNk=",
- Relocations.of("configurate", "ninja{}leaping{}configurate")
+ Relocation.of("configurate", "ninja{}leaping{}configurate")
),
CONFIGURATE_HOCON(
"ninja{}leaping{}configurate",
@@ -158,8 +174,8 @@ public enum Dependency {
"3.3",
"UIy5FVmsBUG6+Z1mpIEE2EXgtOI1ZL0p/eEW+BbtGLU=",
ImmutableList.builder()
- .addAll(Relocations.of("configurate", "ninja{}leaping{}configurate"))
- .addAll(Relocations.of("hocon", "com{}typesafe{}config"))
+ .addAll(Relocation.of("configurate", "ninja{}leaping{}configurate"))
+ .addAll(Relocation.of("hocon", "com{}typesafe{}config"))
.build()
),
HOCON_CONFIG(
@@ -167,7 +183,7 @@ public enum Dependency {
"config",
"1.3.1",
"5vrfxhCCINOmuGqn5OFsnnu4V7pYlViGMIuxOXImSvA=",
- Relocations.of("hocon", "com{}typesafe{}config")
+ Relocation.of("hocon", "com{}typesafe{}config")
);
private final String url;
diff --git a/common/src/main/java/me/lucko/luckperms/common/dependencies/DependencyManager.java b/common/src/main/java/me/lucko/luckperms/common/dependencies/DependencyManager.java
index 02a3a74fb..ed9cf7b60 100644
--- a/common/src/main/java/me/lucko/luckperms/common/dependencies/DependencyManager.java
+++ b/common/src/main/java/me/lucko/luckperms/common/dependencies/DependencyManager.java
@@ -27,8 +27,8 @@ package me.lucko.luckperms.common.dependencies;
import com.google.common.io.ByteStreams;
-import me.lucko.jarrelocator.JarRelocator;
-import me.lucko.jarrelocator.Relocation;
+import me.lucko.luckperms.common.dependencies.relocation.Relocation;
+import me.lucko.luckperms.common.dependencies.relocation.RelocationHandler;
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
import me.lucko.luckperms.common.storage.StorageType;
@@ -53,6 +53,7 @@ public class DependencyManager {
private final MessageDigest digest;
private final DependencyRegistry registry;
private final EnumSet alreadyLoaded = EnumSet.noneOf(Dependency.class);
+ private RelocationHandler relocationHandler = null;
public DependencyManager(LuckPermsPlugin plugin) {
this.plugin = plugin;
@@ -64,23 +65,29 @@ public class DependencyManager {
this.registry = new DependencyRegistry(plugin);
}
+ private synchronized RelocationHandler getRelocationHandler() {
+ if (this.relocationHandler == null) {
+ this.relocationHandler = new RelocationHandler(this);
+ }
+ return this.relocationHandler;
+ }
+
+ public File getSaveDirectory() {
+ File saveDirectory = new File(this.plugin.getDataDirectory(), "lib");
+ if (!(saveDirectory.exists() || saveDirectory.mkdirs())) {
+ throw new RuntimeException("Unable to create lib dir - " + saveDirectory.getPath());
+ }
+
+ return saveDirectory;
+ }
+
public void loadStorageDependencies(Set storageTypes) {
loadDependencies(this.registry.resolveStorageDependencies(storageTypes));
}
public void loadDependencies(Set dependencies) {
- loadDependencies(dependencies, true);
- }
-
- public void loadDependencies(Set dependencies, boolean applyRemapping) {
- if (applyRemapping) {
- this.plugin.getLog().info("Identified the following dependencies: " + dependencies.toString());
- }
-
- File saveDirectory = new File(this.plugin.getDataDirectory(), "lib");
- if (!(saveDirectory.exists() || saveDirectory.mkdirs())) {
- throw new RuntimeException("Unable to create lib dir - " + saveDirectory.getPath());
- }
+ this.plugin.getLog().info("Identified the following dependencies: " + dependencies.toString());
+ File saveDirectory = getSaveDirectory();
// create a list of file sources
List