33 *
44 * This build script configures the compilation, testing, packaging, and publishing
55 * of the BentoBox Minecraft plugin. It handles:
6- * - Java 21 compilation with proper module access
6+ * - Java 25 compilation with proper module access
77 * - Multi-repository dependency resolution
88 * - JAR shading and minimization
99 * - Test execution with JUnit 5
@@ -29,7 +29,9 @@ plugins {
2929 id(" com.gradleup.shadow" ) version " 9.3.0"
3030
3131 // Paperweight UserDev - simplifies development against PaperMC with proper mappings and reobfuscation
32- id(" io.papermc.paperweight.userdev" ) version " 2.0.0-beta.19"
32+ // 2.0.0-SNAPSHOT (from Paper's repo, via pluginManagement in settings.gradle.kts) is required:
33+ // all 26.x dev bundles are data version 8, which released paperweight (<= beta.21) cannot read.
34+ id(" io.papermc.paperweight.userdev" ) version " 2.0.0-SNAPSHOT"
3335
3436 // Sonarcube
3537 id(" org.sonarqube" ) version " 7.2.1.6560"
@@ -46,7 +48,7 @@ paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArt
4648group = " world.bentobox" // From <groupId>
4749
4850// Base properties from <properties>
49- val buildVersion = " 3.17.1 "
51+ val buildVersion = " 3.18.0 "
5052val buildNumberDefault = " -LOCAL" // Local build identifier
5153val snapshotSuffix = " -SNAPSHOT" // Indicates development/snapshot version
5254
@@ -77,23 +79,25 @@ version = finalRevision
7779// DEPENDENCY VERSIONS
7880// ============================================================================
7981// Centralized version management for all external dependencies
80- val javaVersion = " 21"
82+ // Minecraft 26.1+ dev bundles and the 26.2 paper-api are Java 25 artifacts, so BentoBox now
83+ // compiles to Java 25 bytecode. Addons that compile against BentoBox must also move to Java 25.
84+ val javaVersion = " 25"
8185val junitVersion = " 5.10.2"
8286val mockitoVersion = " 5.11.0"
83- // Pin to a concrete JitPack tag rather than the v1.21-SNAPSHOT pointer.
84- // SNAPSHOT resolution on JitPack is flaky — it sometimes advertises a
85- // timestamped version in maven-metadata.xml whose corresponding .pom 404s,
86- // breaking dependency resolution mid-build. Newer tags (>= v4.111) also
87- // currently fail to build on JitPack because the project requires a Java 25
88- // toolchain that JitPack's default image doesn't have. v4.110.0 is the most
89- // recent tag with both POM and JAR available on JitPack.
90- val mockBukkitVersion = " v4.110.0"
87+ // MockBukkit's modern, per-Minecraft-version artifacts are published to Paper's Maven repo
88+ // under org.mockbukkit.mockbukkit (see the testImplementation coordinate below). The closest
89+ // available to Paper 26.2 is the 26.1.2 line (no 26.2 build exists yet); 4.113.2 is the latest.
90+ val mockBukkitVersion = " 4.113.2"
9191val mongodbVersion = " 3.12.12"
9292val mariadbVersion = " 3.0.5"
9393val mysqlVersion = " 8.0.27"
9494val postgresqlVersion = " 42.2.18"
9595val hikaricpVersion = " 5.0.1"
96- val paperVersion = " 1.21.11-R0.1-SNAPSHOT"
96+ // Compile against the latest stable 26.1.2 dev bundle. This is the newest Paper API that has a
97+ // matching MockBukkit release (mockbukkit-v26.1.2); MockBukkit does not yet support 26.2's new
98+ // registries. Minecraft 26.2 is still fully supported at runtime (see ServerCompatibility and
99+ // the Modrinth game-versions list); 26.2-only blocks/entities are accessed via Enums.getIfPresent.
100+ val paperVersion = " 26.1.2.build.72-stable"
97101val bstatsVersion = " 3.0.0"
98102val vaultVersion = " 1.7.1"
99103val levelVersion = " 2.21.3"
@@ -145,7 +149,7 @@ extra["revision"] = finalRevision
145149// ============================================================================
146150// Configures Java compiler and toolchain settings
147151java {
148- // Use Java 21 toolchain for compilation (enforced regardless of JVM running Gradle)
152+ // Use Java 25 toolchain for compilation (enforced regardless of JVM running Gradle)
149153 toolchain {
150154 languageVersion = JavaLanguageVersion .of(javaVersion)
151155 }
@@ -157,7 +161,7 @@ tasks.withType<JavaCompile> {
157161 // Suppress all deprecation and removal warnings during compilation
158162 options.compilerArgs.addAll(listOf (" -Xlint:-deprecation" , " -Xlint:-removal" ))
159163 // Set explicit Java release version for Eclipse compatibility
160- options.release.set(21 )
164+ options.release.set(25 )
161165}
162166
163167tasks.compileTestJava {
@@ -166,7 +170,7 @@ tasks.compileTestJava {
166170 // Suppress all deprecation and removal warnings during compilation
167171 options.compilerArgs.addAll(listOf (" -Xlint:-deprecation" , " -Xlint:-removal" ))
168172 // Set explicit Java release version for Eclipse compatibility
169- options.release.set(21 )
173+ options.release.set(25 )
170174}
171175
172176
@@ -218,7 +222,7 @@ dependencies {
218222 testRuntimeOnly(" org.junit.platform:junit-platform-launcher:$junitVersion " )
219223 testImplementation(" org.mockito:mockito-junit-jupiter:$mockitoVersion " )
220224 testImplementation(" org.mockito:mockito-core:$mockitoVersion " )
221- testImplementation(" com.github.MockBukkit:MockBukkit :$mockBukkitVersion " )
225+ testImplementation(" org.mockbukkit.mockbukkit:mockbukkit-v26.1.2 :$mockBukkitVersion " )
222226 testImplementation(" org.awaitility:awaitility:$awaitilityVersion " )
223227 testImplementation(" io.papermc.paper:paper-api:$paperVersion " )
224228 testImplementation(" com.github.MilkBowl:VaultAPI:$vaultVersion " )
@@ -287,7 +291,7 @@ dependencies {
287291paperweight {
288292 addServerDependencyTo = configurations.named(JavaPlugin .COMPILE_ONLY_CONFIGURATION_NAME ).map { setOf (it) }
289293 javaLauncher = javaToolchains.launcherFor {
290- // Use the project's configured Java version for paperweight tools (needs Java 21+)
294+ // Minecraft 26.1+ dev bundles require Java 25 to run the paperclip patch step.
291295 languageVersion = JavaLanguageVersion .of(javaVersion)
292296 }
293297}
@@ -391,7 +395,7 @@ tasks.test {
391395 // Use JUnit Platform (required for JUnit 5)
392396 useJUnitPlatform()
393397
394- // Enable Java 21 preview features and dynamic agent loading
398+ // Enable Java preview features and dynamic agent loading
395399 jvmArgs(" --enable-preview" , " -XX:+EnableDynamicAgentLoading" )
396400
397401 // Add --add-opens: Required for Java 21+ to allow reflection access to restricted modules
0 commit comments