#22 Fix runtime loading - #185
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to fix a dev-server runtime NoClassDefFoundError caused by trimming Fabric API modules too aggressively, ensuring BlueMap’s Fabric entrypoint has the Fabric API classes it expects during ./gradlew runServer.
Changes:
- Adds
fabric-command-api-v2andfabric-networking-api-v1asruntimeOnlydependencies to satisfy BlueMap’s dev runtime needs without expanding this mod’s compile-time API usage. - Updates the Gradle wrapper (distribution version and regenerated
gradlew/gradlew.batscripts).
Reviewed changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
build.gradle |
Adds Fabric API modules as runtimeOnly to prevent dev runtime classloading failures from BlueMap’s entrypoint. |
gradle/wrapper/gradle-wrapper.properties |
Updates Gradle distribution URL and wrapper download-related settings. |
gradlew |
Regenerated POSIX Gradle wrapper script consistent with the wrapper update. |
gradlew.bat |
Regenerated Windows Gradle wrapper script; includes error-path flow changes that need correction. |
Suppressed comments (1)
gradlew.bat:68
- Same issue as above:
"%COMSPEC%" /c exit 1sets ERRORLEVEL but does not terminate this batch file, so execution continues into:executeeven after printing an invalid JAVA_HOME error. Terminate the script explicitly here.
"%COMSPEC%" /c exit 1
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Fix
NoClassDefFoundErroronCommandRegistrationCallbackin dev serverProblem
After #22 trimmed the Fabric API dependency down to just
fabric-lifecycle-events-v1(the only module this mod's code uses),./gradlew runServerfailed withNoClassDefFoundError/ClassNotFoundExceptiononnet.fabricmc.fabric.api.command.v2.CommandRegistrationCallback.Root cause
BlueMap's own Fabric entrypoint (
de.bluecolored.bluemap.fabric.FabricMod) usesfabric-command-api-v2andfabric-networking-api-v1directly. In production this is harmless — users install the full bundled "Fabric API" mod, which contains every module regardless of what BlueMapSignMarkers declares. ButrunServerpopulates its dev-environment classpath purely from this project's own Gradle dependencies, and BlueMap is dropped straight intorun/modswith no dependency resolution of its own — so trimming to one module left BlueMap's other two modules missing at runtime.Fix
fabric-command-api-v2andfabric-networking-api-v1asruntimeOnlydependencies inbuild.gradle, solely to satisfy BlueMap in the dev server. This project's own code still only depends on (and imports from)fabric-lifecycle-events-v1, so nofabric.mod.jsonchange is needed.Testing
./gradlew buildpasses.viarunServer`.