Skip to content

Commit 93cca6a

Browse files
committed
fix(minestom): configure shadowJar so the loader gets a real JarInJar
The :minestom module declared the shadow plugin but had no shadowJar configuration, so its output was a plain <name>-all.jar with no relocations. :minestom/loader/build.gradle then embeds that file via `from { project(':minestom').tasks.shadowJar.archiveFile }`, which the Shadow plugin unzips because the file has a .jar extension. Result: the published net.luckperms:minestom-loader jar carries un-relocated net/kyori/adventure/** and net/bytebuddy/** at the top level, defeating the JarInJar isolation and pinning every consumer (Titan, etc.) to LuckPerms' bundled Adventure version. Visible in the published artifact. Mirror the :velocity shadowJar config (closest adventure-native analogue): - archiveFileName = 'luckperms-minestom.jarinjar' so the loader's `from` copies it verbatim (Shadow does not unzip non-.jar inputs) and so the JarInJarClassLoader resource lookup matches MinestomLoader's JAR_NAME - the same relocate set as :velocity (adventure, event, caffeine, okio, okhttp3, bytebuddy, commodore, mariadb, mysql, postgresql, hikari, mongodb, bson, jedis, nats, rabbitmq, commonspool2, configurate, yaml) - artifacts { archives shadowJar } so the loader picks up the new file After this, minestom-loader-5.6-SNAPSHOT.jar contains luckperms-minestom.jarinjar as a single resource (no top-level net/kyori/adventure/**) and the embedded LuckPerms platform runs in its JarInJar-isolated classloader as designed. https://claude.ai/code/session_01S76fk9ma5Szkf9r1W44RVP
1 parent 9716796 commit 93cca6a

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

minestom/build.gradle

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,34 @@ dependencies {
1515
compileOnly 'org.slf4j:slf4j-api:2.0.17'
1616
}
1717

18+
shadowJar {
19+
archiveFileName = 'luckperms-minestom.jarinjar'
20+
21+
relocate 'net.kyori.adventure', 'me.lucko.luckperms.lib.adventure'
22+
relocate 'net.kyori.event', 'me.lucko.luckperms.lib.eventbus'
23+
relocate 'com.github.benmanes.caffeine', 'me.lucko.luckperms.lib.caffeine'
24+
relocate 'okio', 'me.lucko.luckperms.lib.okio'
25+
relocate 'okhttp3', 'me.lucko.luckperms.lib.okhttp3'
26+
relocate 'net.bytebuddy', 'me.lucko.luckperms.lib.bytebuddy'
27+
relocate 'me.lucko.commodore', 'me.lucko.luckperms.lib.commodore'
28+
relocate 'org.mariadb.jdbc', 'me.lucko.luckperms.lib.mariadb'
29+
relocate 'com.mysql', 'me.lucko.luckperms.lib.mysql'
30+
relocate 'org.postgresql', 'me.lucko.luckperms.lib.postgresql'
31+
relocate 'com.zaxxer.hikari', 'me.lucko.luckperms.lib.hikari'
32+
relocate 'com.mongodb', 'me.lucko.luckperms.lib.mongodb'
33+
relocate 'org.bson', 'me.lucko.luckperms.lib.bson'
34+
relocate 'redis.clients.jedis', 'me.lucko.luckperms.lib.jedis'
35+
relocate 'io.nats.client', 'me.lucko.luckperms.lib.nats'
36+
relocate 'com.rabbitmq', 'me.lucko.luckperms.lib.rabbitmq'
37+
relocate 'org.apache.commons.pool2', 'me.lucko.luckperms.lib.commonspool2'
38+
relocate 'ninja.leaping.configurate', 'me.lucko.luckperms.lib.configurate'
39+
relocate 'org.yaml.snakeyaml', 'me.lucko.luckperms.lib.yaml'
40+
}
41+
42+
artifacts {
43+
archives shadowJar
44+
}
45+
1846
java {
1947
toolchain {
2048
languageVersion = JavaLanguageVersion.of(25)

0 commit comments

Comments
 (0)