From 0edaeeec99ea07857d15efe74de0b17d25216a47 Mon Sep 17 00:00:00 2001 From: Julian Krings Date: Tue, 8 Jul 2025 23:40:10 +0200 Subject: [PATCH] massive cleanup of maven repos and update dependencies --- build.gradle.kts | 33 ++++++------ core/build.gradle.kts | 91 +++++++++++++++++----------------- gradle/libs.versions.toml | 102 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 162 insertions(+), 64 deletions(-) create mode 100644 gradle/libs.versions.toml diff --git a/build.gradle.kts b/build.gradle.kts index 44ef145a6..fd1f9e400 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -30,10 +30,10 @@ buildscript { plugins { java `java-library` - id("com.gradleup.shadow") version "9.0.0-rc1" - id("de.undercouch.download") version "5.0.1" - id("xyz.jpenilla.run-paper") version "2.3.1" - id("io.sentry.jvm.gradle") version "5.7.0" + alias(libs.plugins.shadow) + alias(libs.plugins.sentry) + alias(libs.plugins.download) + alias(libs.plugins.runPaper) } group = "com.volmit" @@ -93,8 +93,8 @@ nmsBindings.forEach { key, value -> dependencies { compileOnly(project(":core")) - compileOnly("org.jetbrains:annotations:26.0.2") - compileOnly("net.bytebuddy:byte-buddy:1.17.5") + compileOnly(rootProject.libs.annotations) + compileOnly(rootProject.libs.byteBuddy.core) } } @@ -187,23 +187,20 @@ allprojects { mavenCentral() maven("https://repo.papermc.io/repository/maven-public/") maven("https://repo.codemc.org/repository/maven-public/") - maven("https://mvn.lumine.io/repository/maven-public/") - maven("https://jitpack.io") - maven("https://s01.oss.sonatype.org/content/repositories/snapshots") - maven("https://mvn.lumine.io/repository/maven/") - maven("https://repo.triumphteam.dev/snapshots") - maven("https://repo.mineinabyss.com/releases") - maven("https://hub.jeff-media.com/nexus/repository/jeff-media-public/") - maven("https://repo.nexomc.com/releases/") - maven("https://nexus.phoenixdevt.fr/repository/maven-public/") - maven("https://repo.onarandombox.com/content/groups/public/") + maven("https://jitpack.io") // EcoItems, score + maven("https://repo.nexomc.com/releases/") // nexo + maven("https://maven.devs.beer/") // itemsadder + maven("https://repo.extendedclip.com/releases/") // placeholderapi + maven("https://mvn.lumine.io/repository/maven-public/") // mythic + maven("https://nexus.phoenixdevt.fr/repository/maven-public/") //MMOItems + maven("https://repo.onarandombox.com/content/groups/public/") //Multiverse Core } dependencies { // Provided or Classpath - compileOnly("org.projectlombok:lombok:1.18.36") - annotationProcessor("org.projectlombok:lombok:1.18.36") + compileOnly(rootProject.libs.lombok) + annotationProcessor(rootProject.libs.lombok) } /** diff --git a/core/build.gradle.kts b/core/build.gradle.kts index be3b51086..ef7cc7168 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -23,14 +23,14 @@ import java.net.URI plugins { java `java-library` - id("com.gradleup.shadow") - id("io.sentry.jvm.gradle") - id("de.crazydev22.slimjar") version "2.0.6" + alias(libs.plugins.shadow) + alias(libs.plugins.sentry) + alias(libs.plugins.slimjar) } val apiVersion = "1.19" val main = "com.volmit.iris.Iris" -val libs = "com.volmit.iris.util" +val lib = "com.volmit.iris.util" /** * Dependencies. @@ -46,52 +46,51 @@ val libs = "com.volmit.iris.util" */ dependencies { // Provided or Classpath - compileOnly("org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT") - compileOnly("org.apache.logging.log4j:log4j-api:2.19.0") - compileOnly("org.apache.logging.log4j:log4j-core:2.19.0") + compileOnly(libs.spigot) + compileOnly(libs.log4j.api) + compileOnly(libs.log4j.core) // Third Party Integrations - compileOnly("com.nexomc:nexo:1.6.0") - compileOnly("com.github.LoneDev6:api-itemsadder:3.4.1-r4") - compileOnly("com.github.PlaceholderAPI:placeholderapi:2.11.3") - compileOnly("com.github.Ssomar-Developement:SCore:4.23.10.8") - compileOnly("net.Indyuce:MMOItems-API:6.9.5-SNAPSHOT") - compileOnly("com.willfp:EcoItems:5.44.0") - compileOnly("io.lumine:Mythic-Dist:5.2.1") - compileOnly("io.lumine:MythicCrucible-Dist:2.0.0") - compileOnly("me.kryniowesegryderiusz:kgenerators-core:7.3") { + compileOnly(libs.nexo) + compileOnly(libs.itemsadder) + compileOnly(libs.placeholderApi) + compileOnly(libs.score) + compileOnly(libs.mmoitems) + compileOnly(libs.ecoitems) + compileOnly(libs.mythic) + compileOnly(libs.mythicChrucible) + compileOnly(libs.kgenerators) { isTransitive = false } - compileOnly("org.mvplugins.multiverse.core:multiverse-core:5.1.0") - //implementation files("libs/CustomItems.jar") + compileOnly(libs.multiverseCore) // Shaded implementation(slimjar()) // Dynamically Loaded - slim("com.dfsek:paralithic:0.8.1") - slim("io.papermc:paperlib:1.0.5") - slim("net.kyori:adventure-text-minimessage:4.17.0") - slim("net.kyori:adventure-platform-bukkit:4.3.4") - slim("net.kyori:adventure-api:4.17.0") - slim("org.bstats:bstats-bukkit:3.1.0") - slim("io.sentry:sentry:8.12.0") + slim(libs.paralithic) + slim(libs.paperlib) + slim(libs.adventure.api) + slim(libs.adventure.minimessage) + slim(libs.adventure.platform) + slim(libs.bstats) + slim(libs.sentry) - slim("commons-io:commons-io:2.13.0") - slim("commons-lang:commons-lang:2.6") - slim("com.github.oshi:oshi-core:6.6.5") - slim("org.lz4:lz4-java:1.8.0") - slim("it.unimi.dsi:fastutil:8.5.8") - slim("com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:1.4.2") - slim("org.zeroturnaround:zt-zip:1.14") - slim("com.google.code.gson:gson:2.10.1") - slim("org.ow2.asm:asm:9.8") - slim("bsf:bsf:2.4.0") - slim("rhino:js:1.7R2") - slim("com.github.ben-manes.caffeine:caffeine:3.0.6") - slim("org.apache.commons:commons-lang3:3.12.0") - slim("net.bytebuddy:byte-buddy:1.17.5") - slim("net.bytebuddy:byte-buddy-agent:1.17.5") + slim(libs.commons.io) + slim(libs.commons.lang) + slim(libs.commons.lang3) + slim(libs.oshi) + slim(libs.lz4) + slim(libs.fastutil) + slim(libs.lru) + slim(libs.zip) + slim(libs.gson) + slim(libs.asm) + slim(libs.bsf) + slim(libs.rhino) + slim(libs.caffeine) + slim(libs.byteBuddy.core) + slim(libs.byteBuddy.agent) } java { @@ -113,11 +112,11 @@ slimJar { URI.create("https://repo.maven.apache.org/maven2/").toURL() )) - relocate("com.dfsek.paralithic", "$libs.paralithic") - relocate("io.papermc.lib", "$libs.paper") - relocate("net.kyori", "$libs.kyori") - relocate("org.bstats", "$libs.metrics") - relocate("io.sentry", "$libs.sentry") + relocate("com.dfsek.paralithic", "$lib.paralithic") + relocate("io.papermc.lib", "$lib.paper") + relocate("net.kyori", "$lib.kyori") + relocate("org.bstats", "$lib.metrics") + relocate("io.sentry", "$lib.sentry") } tasks { @@ -147,7 +146,7 @@ tasks { shadowJar { mergeServiceFiles() //minimize() - relocate("io.github.slimjar", "$libs.slimjar") + relocate("io.github.slimjar", "$lib.slimjar") } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 000000000..81d36c3ee --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,102 @@ +# Version catalog is a central place for you to declare and version dependencies +# https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog +# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format + +[versions] +# Plugins +shadow = "9.0.0-rc1" # https://plugins.gradle.org/plugin/com.gradleup.shadow +slimjar = "2.0.6" # https://plugins.gradle.org/plugin/de.crazydev22.slimjar +download = "5.6.0" # https://plugins.gradle.org/plugin/de.undercouch.download +runPaper = "2.3.1" # https://plugins.gradle.org/plugin/xyz.jpenilla.run-paper +sentryPlugin = "5.8.0" # https://github.com/getsentry/sentry-android-gradle-plugin + +# Core Libraries +lombok = "1.18.38" +spigot = "1.20.1-R0.1-SNAPSHOT" # https://hub.spigotmc.org/nexus/repository/snapshots/org/spigotmc/spigot-api/maven-metadata.xml +log4j = "2.19.0" # https://central.sonatype.com/artifact/org.apache.logging.log4j/log4j-api +adventure-api = "4.23.0" # https://github.com/KyoriPowered/adventure +adventure-platform = "4.4.0" # https://github.com/KyoriPowered/adventure-platform + +annotations = "26.0.2" # https://central.sonatype.com/artifact/org.jetbrains/annotations +paralithic = "0.8.1" # https://github.com/PolyhedralDev/Paralithic/ +paperlib = "1.0.8" # https://github.com/PaperMC/PaperLib/ +bstats = "3.1.0" # https://github.com/Bastian/bstats-metrics/tree/master +sentry = "8.14.0" # https://github.com/getsentry/sentry-java +commons-io = "2.19.0" # https://central.sonatype.com/artifact/commons-io/commons-io +commons-lang = "2.6" # https://central.sonatype.com/artifact/commons-lang/commons-lang +commons-lang3 = "3.17.0" # https://central.sonatype.com/artifact/org.apache.commons/commons-lang3 +oshi = "6.8.2" # https://central.sonatype.com/artifact/com.github.oshi/oshi-core +fastutil = "8.5.16" # https://central.sonatype.com/artifact/it.unimi.dsi/fastutil +lz4 = "1.8.0" # https://central.sonatype.com/artifact/org.lz4/lz4-java +lru = "1.4.2" # https://central.sonatype.com/artifact/com.googlecode.concurrentlinkedhashmap/concurrentlinkedhashmap-lru +zip = "1.17" # https://central.sonatype.com/artifact/org.zeroturnaround/zt-zip +gson = "2.13.1" # https://central.sonatype.com/artifact/com.google.code.gson/gson +asm = "9.8" # https://central.sonatype.com/artifact/org.ow2.asm/asm +bsf = "2.4.0" # https://central.sonatype.com/artifact/bsf/bsf +rhino = "1.7R2" # https://central.sonatype.com/artifact/rhino/js +caffeine = "3.2.1" # https://central.sonatype.com/artifact/com.github.ben-manes.caffeine/caffeine +byte-buddy = "1.17.6" # https://central.sonatype.com/artifact/net.bytebuddy/byte-buddy + +# Third Party Integrations +nexo = "1.8.0" # https://repo.nexomc.com/#/releases/com/nexomc/nexo +itemsadder = "4.0.10" # https://github.com/LoneDev6/API-ItemsAdder +placeholderApi = "2.11.6" # https://repo.extendedclip.com/#/releases/me/clip/placeholderapi +score = "5.25.3.9" # https://github.com/Ssomar-Developement/SCore +mmoitems = "6.9.5-SNAPSHOT" # https://nexus.phoenixdevt.fr/repository/maven-public/net/Indyuce/MMOItems-API/maven-metadata.xml +ecoitems = "5.63.1" # https://github.com/Auxilor/EcoItems/tags +mythic = "5.9.5" +mythic-chrucible = "2.1.0" +kgenerators = "7.3" # https://repo.codemc.io/repository/maven-public/me/kryniowesegryderiusz/kgenerators-core/maven-metadata.xml +multiverseCore = "5.1.0" + +[libraries] +# Core Libraries +lombok = { module = "org.projectlombok:lombok", version.ref ="lombok" } +spigot = { module = "org.spigotmc:spigot-api", version.ref = "spigot" } +log4j-api = { module = "org.apache.logging.log4j:log4j-api", version.ref = "log4j" } +log4j-core = { module = "org.apache.logging.log4j:log4j-core", version.ref = "log4j" } +annotations = { module = "org.jetbrains:annotations", version.ref = "annotations" } + +# Dynamically Loaded +adventure-api = { module = "net.kyori:adventure-api", version.ref = "adventure-api" } +adventure-minimessage = { module = "net.kyori:adventure-text-minimessage", version.ref = "adventure-api" } +adventure-platform = { module = "net.kyori:adventure-platform-bukkit", version.ref = "adventure-platform" } + +paralithic = { module = "com.dfsek:paralithic", version.ref = "paralithic" } +paperlib = { module = "io.papermc:paperlib", version.ref = "paperlib" } +bstats = { module = "org.bstats:bstats-bukkit", version.ref = "bstats" } +sentry = { module = "io.sentry:sentry", version.ref = "sentry" } +commons-io = { module = "commons-io:commons-io", version.ref = "commons-io" } +commons-lang = { module = "commons-lang:commons-lang", version.ref = "commons-lang" } +commons-lang3 = { module = "org.apache.commons:commons-lang3", version.ref = "commons-lang3" } +oshi = { module = "com.github.oshi:oshi-core", version.ref = "oshi" } +lz4 = { module = "org.lz4:lz4-java", version.ref = "lz4" } +fastutil = { module = "it.unimi.dsi:fastutil", version.ref = "fastutil" } +lru = { module = "com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru", version.ref = "lru" } +zip = { module = "org.zeroturnaround:zt-zip", version.ref = "zip" } +gson = { module = "com.google.code.gson:gson", version.ref = "gson" } +asm = { module = "org.ow2.asm:asm", version.ref = "asm" } +bsf = { module = "bsf:bsf", version.ref = "bsf" } +rhino = { module = "rhino:js", version.ref = "rhino" } +caffeine = { module = "com.github.ben-manes.caffeine:caffeine", version.ref = "caffeine" } +byteBuddy-core = { module = "net.bytebuddy:byte-buddy", version.ref = "byte-buddy" } +byteBuddy-agent = { module = "net.bytebuddy:byte-buddy-agent", version.ref = "byte-buddy" } + +# Third Party Integrations +nexo = { module = "com.nexomc:nexo", version.ref = "nexo" } +itemsadder = { module = "dev.lone:api-itemsadder", version.ref = "itemsadder" } +placeholderApi = { module = "me.clip:placeholderapi", version.ref = "placeholderApi" } +score = { module = "com.github.Ssomar-Developement:SCore", version.ref = "score" } +mmoitems = { module = "net.Indyuce:MMOItems-API", version.ref = "mmoitems" } +ecoitems = { module = "com.willfp:EcoItems", version.ref = "ecoitems" } +mythic = { module = "io.lumine:Mythic-Dist", version.ref = "mythic" } +mythicChrucible = { module = "io.lumine:MythicCrucible-Dist", version.ref = "mythic-chrucible" } +kgenerators = { module = "me.kryniowesegryderiusz:kgenerators-core", version.ref = "kgenerators" } +multiverseCore = { module = "org.mvplugins.multiverse.core:multiverse-core", version.ref = "multiverseCore" } + +[plugins] +shadow = { id = "com.gradleup.shadow", version.ref = "shadow" } +slimjar = { id = "de.crazydev22.slimjar", version.ref = "slimjar" } +download = { id = "de.undercouch.download", version.ref = "download" } +runPaper = { id = "xyz.jpenilla.run-paper", version.ref = "runPaper" } +sentry = { id = "io.sentry.jvm.gradle", version.ref = "sentryPlugin" }