fix(minestom): configure shadowJar so the loader gets a real JarInJar#3
Open
TheMeinerLP wants to merge 1 commit into
Open
fix(minestom): configure shadowJar so the loader gets a real JarInJar#3TheMeinerLP wants to merge 1 commit into
TheMeinerLP wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The published
net.luckperms:minestom-loader:5.6-SNAPSHOTjar carries un-relocatednet/kyori/adventure/**andnet/bytebuddy/**at the top level. That defeats the JarInJar isolation and pins every consumer (Titan, etc.) to LuckPerms' bundled (older) Adventure version, causing runtime failures like:…on modern Minestom (
2026.05.17-1.21.11).Root cause
:minestom/build.gradledeclares the shadow plugin but has noshadowJarconfiguration:<name>-all.jar(plain.jarextension), and:minestom/loader/build.gradlethen embeds the file viashadowJar { from { project(':minestom').tasks.shadowJar.archiveFile } }Because the input is a
.jar, the Shadow plugin unzips it into the outer loader jar. Combined with the missing relocations, the loader jar ends up withnet/kyori/adventure/**andnet/bytebuddy/**at top level instead of carrying the inner shadow jar as a single resource.Fix
Mirror the
:velocityshadowJar configuration (the closest analogue, since Velocity is also an Adventure-native platform):archiveFileName = 'luckperms-minestom.jarinjar'— Shadow does not unzip non-.jarinputs, so the loader'sfromcopies the file verbatim; the name also matches theJAR_NAMEconstant inMinestomLoader.javathat theJarInJarClassLoaderlooks up at runtime.:velocity(adventure, event, caffeine, okio, okhttp3, bytebuddy, commodore, mariadb, mysql, postgresql, hikari, mongodb, bson, jedis, nats, rabbitmq, commons-pool2, configurate, snakeyaml).artifacts { archives shadowJar }so the loader picks up the configured archive.Effect
After this change,
minestom-loader-5.6-SNAPSHOT.jarcontainsluckperms-minestom.jarinjaras a single resource (no top-levelnet/kyori/adventure/**) and the embedded LuckPerms platform runs inside its JarInJar-isolated classloader as designed — restoring the same isolation guarantees the Bukkit/Velocity loaders already provide.Test plan
:minestom:shadowJarand:minestom:loader:shadowJarsuccessfully.minestom-loader-<ver>.jar: top-level entries areme/lucko/...,META-INF/,luckperms-minestom.jarinjar— and nonet/kyori/adventure/**ornet/bytebuddy/**at the top level.5.6-SNAPSHOTdeploys to the OLF snapshots repo.LuckPermsProvider.get()works, no AdventureNoSuchMethodErroron Minestom2026.05.17-1.21.11.Generated by Claude Code