From 46941452d35564e9fded5c85f72fba57cb605ddb Mon Sep 17 00:00:00 2001
From: Eric <60104846+ericlmao@users.noreply.github.com>
Date: Thu, 19 Nov 2026 18:53:19 +0100
Subject: [PATCH] fix: resolve runtime libraries from Maven Central only and
default to Moss 1.2.3
PaperPluginLoader no longer adds the repo.moonrise.gg releases and snapshots
repositories at server start: the engine's runtime libraries all come from
Maven Central through Paper's Central mirror, and a plugin that needs another
repository adds it in addLibraries. The default Moss moves to 1.2.3, the first
Moss release on Maven Central (1.2.2 exists only on repo.moonrise.gg).
The build resolves Moss 1.2.3 from Maven Central for every module and drops
the Moonrise repositories; publishing to Nexus is unchanged. Version 1.10.2.
---
README.md | 45 ++++++++-----------
build.gradle.kts | 4 --
bungeecord/build.gradle.kts | 6 +--
common/build.gradle.kts | 4 +-
paper/build.gradle.kts | 6 +--
.../paper/loader/PaperPluginLoader.java | 13 +++---
.../paper/loader/PaperPluginLoaderTest.java | 28 ++++++++++++
velocity/build.gradle.kts | 2 +-
8 files changed, 63 insertions(+), 45 deletions(-)
diff --git a/README.md b/README.md
index ad263de..a786b1e 100644
--- a/README.md
+++ b/README.md
@@ -31,57 +31,48 @@ Organization: https://github.com/moonrise-studios
## Installation
-Releases from `1.10.1` are published to Maven Central under `gg.moonrise.engine`. The Moonrise Maven repository also hosts older releases and snapshots.
+Releases from `1.10.1` are published to Maven Central under `gg.moonrise.engine`, so no extra repository is
+needed. Older releases and snapshots remain on the Moonrise Maven repository
+(`https://repo.moonrise.gg/repository/maven-releases/` and `.../maven-snapshots/`); add it only to consume one of
+those.
### Gradle (Kotlin DSL)
```kotlin
repositories {
mavenCentral()
- maven("https://repo.moonrise.gg/repository/maven-releases/")
- maven("https://repo.moonrise.gg/repository/maven-snapshots/")
}
-```
-
-Then add dependencies:
-```kotlin
dependencies {
- implementation("gg.moonrise.engine:plugin-engine-paper:1.10.1")
- // or: implementation("gg.moonrise.engine:plugin-engine-bungeecord:1.10.1")
- // or: implementation("gg.moonrise.engine:plugin-engine-velocity:1.10.1")
- // or: implementation("gg.moonrise.engine:plugin-engine-common:1.10.1")
+ implementation("gg.moonrise.engine:plugin-engine-paper:1.10.2")
+ // or: implementation("gg.moonrise.engine:plugin-engine-bungeecord:1.10.2")
+ // or: implementation("gg.moonrise.engine:plugin-engine-velocity:1.10.2")
+ // or: implementation("gg.moonrise.engine:plugin-engine-common:1.10.2")
}
```
### Maven
-```xml
-
-
- moonrise-releases
- https://repo.moonrise.gg/repository/maven-releases/
-
-
- moonrise-snapshots
- https://repo.moonrise.gg/repository/maven-snapshots/
-
-
-```
+Maven Central is Maven's default repository, so only the dependency is needed:
```xml
gg.moonrise.engine
plugin-engine-paper
- 1.10.1
+ 1.10.2
-
-
+
+
```
-Use `-SNAPSHOT` versions when consuming snapshot builds.
+### Runtime libraries (Paper)
+
+`PaperPluginLoader` resolves the engine's runtime libraries (Spring, Moss, ConfigLib, Cloud) and the plugin's
+`libraries()` at server start from Maven Central only, through Paper's Central mirror
+(`PAPER_DEFAULT_CENTRAL_REPOSITORY` or Google's mirror). A plugin that needs a library from another repository
+adds that repository in `addLibraries(MavenLibraryResolver)`.
## Quick start (Paper plugins)
diff --git a/build.gradle.kts b/build.gradle.kts
index 9a9aa4d..b0e6425 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -14,10 +14,6 @@ subprojects {
maven("https://repo1.maven.org/maven2/")
mavenCentral()
- // Moonrise
- maven("https://repo.moonrise.gg/repository/maven-releases/")
- maven("https://repo.moonrise.gg/repository/maven-snapshots/")
-
// PaperMC
maven("https://repo.papermc.io/repository/maven-public/")
diff --git a/bungeecord/build.gradle.kts b/bungeecord/build.gradle.kts
index b82ddde..c962e34 100644
--- a/bungeecord/build.gradle.kts
+++ b/bungeecord/build.gradle.kts
@@ -6,7 +6,7 @@ plugins {
var id = "plugin-engine-bungeecord"
var domain = "gg.moonrise.engine"
-var apiVersion = "1.10.1"
+var apiVersion = "1.10.2"
repositories {
maven("https://repo1.maven.org/maven2/")
@@ -25,8 +25,8 @@ dependencies {
compileOnly("org.incendo:cloud-bungee:2.0.0-beta.10")
// Moss
- compileOnly("gg.moonrise.moss:moss-common:1.2.2")
- compileOnly("gg.moonrise.moss:moss-bungeecord:1.2.2")
+ compileOnly("gg.moonrise.moss:moss-common:1.2.3")
+ compileOnly("gg.moonrise.moss:moss-bungeecord:1.2.3")
// Adventure
compileOnly("net.kyori:adventure-api:4.26.1")
diff --git a/common/build.gradle.kts b/common/build.gradle.kts
index c5ed2f6..4456e13 100644
--- a/common/build.gradle.kts
+++ b/common/build.gradle.kts
@@ -6,7 +6,7 @@ plugins {
var id = "plugin-engine-common"
var domain = "gg.moonrise.engine"
-var apiVersion = "1.10.1"
+var apiVersion = "1.10.2"
repositories {
maven("https://repo1.maven.org/maven2/")
@@ -19,7 +19,7 @@ dependencies {
compileOnly("org.incendo:cloud-core:2.0.0")
// Moss
- compileOnly("gg.moonrise.moss:moss-common:1.2.2")
+ compileOnly("gg.moonrise.moss:moss-common:1.2.3")
// Adventure
compileOnly("net.kyori:adventure-api:4.26.1")
diff --git a/paper/build.gradle.kts b/paper/build.gradle.kts
index a220d83..f3bd661 100644
--- a/paper/build.gradle.kts
+++ b/paper/build.gradle.kts
@@ -6,7 +6,7 @@ plugins {
var id = "plugin-engine-paper"
var domain = "gg.moonrise.engine"
-var apiVersion = "1.10.1"
+var apiVersion = "1.10.2"
repositories {
maven("https://repo1.maven.org/maven2/")
@@ -26,8 +26,8 @@ dependencies {
compileOnly("org.incendo:cloud-paper:2.0.1")
// Moss
- compileOnly("gg.moonrise.moss:moss-common:1.2.2")
- compileOnly("gg.moonrise.moss:moss-paper:1.2.2")
+ compileOnly("gg.moonrise.moss:moss-common:1.2.3")
+ compileOnly("gg.moonrise.moss:moss-paper:1.2.3")
// PlaceholderAPI
compileOnly("me.clip:placeholderapi:2.11.7")
diff --git a/paper/src/main/java/gg/moonrise/engine/paper/loader/PaperPluginLoader.java b/paper/src/main/java/gg/moonrise/engine/paper/loader/PaperPluginLoader.java
index 48d28c3..68be359 100644
--- a/paper/src/main/java/gg/moonrise/engine/paper/loader/PaperPluginLoader.java
+++ b/paper/src/main/java/gg/moonrise/engine/paper/loader/PaperPluginLoader.java
@@ -13,7 +13,11 @@
import java.util.Objects;
/**
- * Represents the SkylandsPluginLoader class.
+ * Paper plugin loader that resolves the engine's runtime libraries (Spring, Moss, ConfigLib, Cloud) and the
+ * plugin's own {@link #libraries()} at server start. Every library is resolved from Maven Central through Paper's
+ * Central mirror ({@code PAPER_DEFAULT_CENTRAL_REPOSITORY}, the {@code org.bukkit.plugin.java.LibraryLoader.centralURL}
+ * system property, or Google's Maven Central mirror). A plugin that needs another repository adds it in
+ * {@link #addLibraries(MavenLibraryResolver)}.
*/
public abstract class PaperPluginLoader implements PluginLoader {
@@ -21,7 +25,7 @@ public abstract class PaperPluginLoader implements PluginLoader {
"org.springframework:spring-context:6.2.13",
"jakarta.annotation:jakarta.annotation-api:3.0.0",
"de.exlll:configlib-yaml:4.8.1",
- "gg.moonrise.moss:moss-paper:1.2.2",
+ "gg.moonrise.moss:moss-paper:1.2.3",
"org.incendo:cloud-paper:2.0.1",
"org.incendo:cloud-annotations:2.0.0"
);
@@ -37,8 +41,6 @@ public void classloader(PluginClasspathBuilder builder) {
MavenLibraryResolver resolver = new MavenLibraryResolver();
resolver.addRepository(new RemoteRepository.Builder("central", "default", getDefaultMavenCentralMirror()).build());
- resolver.addRepository(new RemoteRepository.Builder("moonrise-releases", "default", "https://repo.moonrise.gg/repository/maven-releases/").build());
- resolver.addRepository(new RemoteRepository.Builder("moonrise-snapshots", "default", "https://repo.moonrise.gg/repository/maven-snapshots/").build());
for (String coordinates : runtimeLibraries()) {
resolver.addDependency(dependency(coordinates));
@@ -59,7 +61,8 @@ public void onClassLoaderInit(PluginClasspathBuilder builder) {
}
/**
- * Executes addLibraries.
+ * Adds anything else to the resolver after the runtime libraries, such as another repository for a library
+ * that is not on Maven Central.
* @param resolver the resolver
*/
diff --git a/paper/src/test/java/gg/moonrise/engine/paper/loader/PaperPluginLoaderTest.java b/paper/src/test/java/gg/moonrise/engine/paper/loader/PaperPluginLoaderTest.java
index 5417b81..6b90871 100644
--- a/paper/src/test/java/gg/moonrise/engine/paper/loader/PaperPluginLoaderTest.java
+++ b/paper/src/test/java/gg/moonrise/engine/paper/loader/PaperPluginLoaderTest.java
@@ -5,6 +5,7 @@
import io.papermc.paper.plugin.loader.library.ClassPathLibrary;
import io.papermc.paper.plugin.loader.library.impl.MavenLibraryResolver;
import org.eclipse.aether.graph.Dependency;
+import org.eclipse.aether.repository.RemoteRepository;
import org.junit.jupiter.api.Test;
import java.lang.reflect.Field;
@@ -35,6 +36,25 @@ void registersStableCloudPaperRuntime() throws ReflectiveOperationException {
assertFalse(coordinates.contains("org.incendo:cloud-paper:jar:2.0.0-beta.10"));
}
+ @Test
+ void resolvesOnlyFromTheMavenCentralMirror() throws ReflectiveOperationException {
+ CapturingClasspathBuilder builder = new CapturingClasspathBuilder();
+ new PaperPluginLoader() {
+ }.classloader(builder);
+
+ List repositories = repositories(builder.resolver());
+
+ assertEquals(List.of("central"), repositories.stream().map(RemoteRepository::getId).toList());
+ assertFalse(repositories.getFirst().getUrl().contains("repo.moonrise.gg"));
+ }
+
+ @Test
+ void defaultMossIsTheFirstReleaseOnMavenCentral() throws ReflectiveOperationException {
+ List coordinates = resolvedCoordinates(loader(List.of()));
+
+ assertTrue(coordinates.contains("gg.moonrise.moss:moss-paper:jar:1.2.3"));
+ }
+
@Test
void libraryReplacesTheEngineDefaultWithTheSameArtifact() throws ReflectiveOperationException {
List coordinates = resolvedCoordinates(loader(List.of("org.incendo:cloud-paper:2.0.2")));
@@ -96,6 +116,14 @@ private static List dependencies(MavenLibraryResolver resolver)
return List.copyOf((List) field.get(resolver));
}
+ @SuppressWarnings("unchecked")
+ private static List repositories(MavenLibraryResolver resolver)
+ throws ReflectiveOperationException {
+ Field field = MavenLibraryResolver.class.getDeclaredField("repositories");
+ field.setAccessible(true);
+ return List.copyOf((List) field.get(resolver));
+ }
+
private static final class CapturingClasspathBuilder implements PluginClasspathBuilder {
private final List libraries = new ArrayList<>();
diff --git a/velocity/build.gradle.kts b/velocity/build.gradle.kts
index 4ce1324..2bc87dd 100644
--- a/velocity/build.gradle.kts
+++ b/velocity/build.gradle.kts
@@ -6,7 +6,7 @@ plugins {
var id = "plugin-engine-velocity"
var domain = "gg.moonrise.engine"
-var apiVersion = "1.10.1"
+var apiVersion = "1.10.2"
repositories {
maven("https://repo1.maven.org/maven2/")