Skip to content

build: switch to the OneLiteFeather minestom-extensions fork - #207

Open
TheMeinerLP wants to merge 1 commit into
build/buildsrc-conventionsfrom
build/minestom-extensions
Open

build: switch to the OneLiteFeather minestom-extensions fork#207
TheMeinerLP wants to merge 1 commit into
build/buildsrc-conventionsfrom
build/minestom-extensions

Conversation

@TheMeinerLP

Copy link
Copy Markdown
Contributor

Gestapelt auf #206. Base ist build/buildsrc-conventions; GitHub setzt die Base automatisch auf main, sobald #206 gemergt ist. Der Diff hier zeigt nur die Extension-Migration.

Warum

dev.hollowcube:minestom-ce-extensions ist archiviert und lädt Extension-Abhängigkeiten über eine Kotlin-Klasse (net.minestom.dependencies.maven.MavenRepository). Das erzwang zwei Workarounds, die beide als Kommentar im Build standen:

  • kotlin-stdlib-jdk8 in den Fat Jar bündeln, sonst NoClassDefFoundError: kotlin/jvm/internal/Intrinsics
  • den reposilite-JitPack-Proxy für com.github.Minestom:DependencyGetter

Dazu kam ein Reflection-Hack in TitanApplication, weil ExtensionBootstrap.init() kein Auth annahm.

Was

Wechsel auf net.onelitefeather:minestom-extensions 2.2.0 — den OLF-Fork. Gleiche Pakete (net.hollowcube.minestom.extensions, net.minestom.server.extensions), aber Auflösung über Maven Resolver.

Beide Workarounds entfallen:

  • kotlin-stdlib-jdk8 raus aus :app und aus dem Version-Katalog
  • JitPack-Proxy ersetzt durch das credential-freie OneLiteFeatherReleases-Repository, in dem der Fork liegt

Der Reflection-Hack entfällt. Der Fork bietet ExtensionBootstrap.init(Auth) (minestom-extensions#7, Release 2.2.0) — genau für diesen Fall:

-        MinecraftServer server = MinecraftServer.init(new Auth.Velocity(secret));
-        try {
-            var constructor = ExtensionBootstrap.class.getDeclaredConstructor(MinecraftServer.class);
-            constructor.setAccessible(true);
-            return constructor.newInstance(server);
-        } catch (ReflectiveOperationException exception) {
-            throw new IllegalStateException("Failed to initialise the extension bootstrap", exception);
-        }
+        return ExtensionBootstrap.init(new Auth.Velocity(secret));

Damit ist offener Punkt 1 des OLF-Minestom-Project-Standards erledigt.

:bridge generiert extension.json aus @ExtensionInfo statt sie von Hand zu pflegen (OLF-L5-01). Die handgeschriebene Datei und der ReplaceTokens-Filter für @version@ sind weg.

Verifikation

Generierte vs. handgepflegte extension.json — inhaltlich identisch, nur Schlüsselreihenfolge und Whitespace unterscheiden sich:

Feld vorher nachher
name TitanCloudNetPermissions TitanCloudNetPermissions
entrypoint net.onelitefeather.titan.bridge.TitanBridgePermissionExtension dito
version 1.14.0 1.14.0
authors ["OneLiteFeather"] ["OneLiteFeather"]
dependencies ["CloudNet_Bridge"] ["CloudNet_Bridge"]

Das Bridge-Jar enthält exakt dieselben Einträge wie vorher — @ExtensionInfo hat Source-Retention, die Annotation landet nicht im Jar.

Kalter Gradle-Cache (frisches --gradle-user-home): alle 65 Module lösen ohne den JitPack-Proxy auf, inklusive com.github.CloudNetService.cloud-command-framework — das kommt von repository.derklaro.dev.

Velocity-Pfad am echten Fat Jar (das ist der Zweig, der vorher Reflection brauchte):

java -Dminestom.velocity.secret=… -jar app-titan.jar

Kommt an ExtensionBootstrap und LuckPerms vorbei und bleibt an NoSuchFileException: worlds hängen — derselbe Punkt, an dem auch der Jar vor der Änderung im identischen Lauf stehen bleibt (Kontrolllauf durchgeführt). Kein NoClassDefFoundError mehr.

Tests: 56, 0 Fehler — unverändert.

Nebeneffekt: Fat Jar wird 2,8 MB kleiner

43,7 MB → 40,8 MB, 25.650 → 23.719 Einträge.

entfernt hinzugefügt
org/apache/commons 636 org/apache/http 766
org/jboss/shrinkwrap 508 org/eclipse/aether 244
kotlin/** ~700 org/objectweb/asm 40
org/codehaus/plexus 155
org/jsoup ~200
org/arquillian/spacelift 98

Der alte DependencyGetter zog shrinkwrap-resolver, arquillian-spacelift und jsoup mit; Maven Resolver ersetzt das durch aether + httpclient.

Anmerkungen

  • Commit-Typ ist build:, erzeugt also keinen Changelog-Eintrag. Falls der Loader-Wechsel für Ops in CHANGELOG.md sichtbar sein soll, sage Bescheid — dann wird ein feat: daraus.
  • Beim Smoke-Test fiel auf: der Fat Jar startet mit SLF4J(W): No SLF4J providers were found und loggt damit gar nichts. Vorbestehend, auch im Baseline-Jar. Cygnus deklariert dafür slf4j-simple als runtimeOnly. Eigener PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QtbnMbAj6m2q3vrDYFizDr

@TheMeinerLP
TheMeinerLP requested a review from a team as a code owner August 27, 2026 19:55
@TheMeinerLP
TheMeinerLP force-pushed the build/buildsrc-conventions branch from c9a0860 to 00dfaed Compare August 27, 2026 20:03
dev.hollowcube:minestom-ce-extensions is archived and resolves extension
dependencies through a Kotlin class (net.minestom.dependencies.maven.
MavenRepository). That forced two workarounds Titan carried in comments:
bundling kotlin-stdlib-jdk8 into the fat jar, and routing resolution
through the reposilite JitPack proxy for com.github.Minestom:
DependencyGetter.

net.onelitefeather:minestom-extensions 2.2.0 keeps the same packages
(net.hollowcube.minestom.extensions, net.minestom.server.extensions) but
resolves through Maven Resolver, so both workarounds are gone:

- kotlin-stdlib-jdk8 dropped from :app and from the version catalog
- the JitPack proxy repository replaced by the credential-free
  OneLiteFeatherReleases repository the fork is published to. Verified
  with a cold Gradle user home: all 65 modules resolve without it,
  com.github.CloudNetService.cloud-command-framework included (it comes
  from repository.derklaro.dev).

The fork also offers ExtensionBootstrap.init(Auth), added upstream for
exactly this case. Titan's Velocity path no longer has to reach for
getDeclaredConstructor(MinecraftServer.class) + setAccessible(true) - the
reflection hack listed as open point 1 in the OLF Minestom project
standard is gone.

:bridge now generates extension.json from @ExtensionInfo instead of
keeping a hand-written file plus a ReplaceTokens filter for @Version@.
The generated descriptor carries the same name, entrypoint, version,
authors and dependencies; only key order and whitespace differ. The
annotation has source retention, so the bridge jar holds exactly the same
entries as before.

Verified: 56 tests, 0 failures (unchanged). The Velocity branch was smoke
tested against the real fat jar with -Dminestom.velocity.secret set; it
gets past ExtensionBootstrap and LuckPerms and stops at the same missing
worlds/ directory as the pre-change jar does in the same run.

Fat jar shrinks from 43.7 MB to 40.8 MB (25650 to 23719 entries): the old
DependencyGetter dragged in shrinkwrap-resolver, arquillian-spacelift,
jsoup and a large commons/plexus tree; Maven Resolver replaces them with
aether plus httpclient.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QtbnMbAj6m2q3vrDYFizDr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant