build: 在 Velocity 中引入 relocate 后的 netty,防止依赖版本冲突
All checks were successful
Publish Project / build (push) Successful in 5m3s

This commit is contained in:
2025-07-10 20:36:26 +08:00
parent ad216ef89b
commit d16602a06d

View File

@@ -1,6 +1,9 @@
@file:Suppress("VulnerableLibrariesLocal") @file:Suppress("VulnerableLibrariesLocal")
evaluationDependsOn(":core-common") evaluationDependsOn(":core-common")
evaluationDependsOn(":core-relocate-lettuce")
val shade = configurations.create("shade")
dependencies { dependencies {
api(project(":core-common")) { isTransitive = false } api(project(":core-common")) { isTransitive = false }
@@ -14,10 +17,11 @@ dependencies {
exclude(group = "com.google.code.gson") exclude(group = "com.google.code.gson")
exclude(group = "org.slf4j") exclude(group = "org.slf4j")
} }
api("io.lettuce:lettuce-core:6.7.1.RELEASE") { compileOnlyApi("io.lettuce:lettuce-core:6.7.1.RELEASE") {
exclude(group = "io.netty")
exclude(group = "org.slf4j") exclude(group = "org.slf4j")
exclude(group = "io.netty")
} }
shade(project(":core-relocate-lettuce"))
// https://mvnrepository.com/artifact/com.mysql/mysql-connector-j // https://mvnrepository.com/artifact/com.mysql/mysql-connector-j
runtimeOnly("com.mysql:mysql-connector-j:8.4.0") runtimeOnly("com.mysql:mysql-connector-j:8.4.0")
@@ -50,6 +54,13 @@ tasks {
archiveBaseName = "HamsterCore-Velocity" archiveBaseName = "HamsterCore-Velocity"
} }
shadowJar { shadowJar {
dependsOn(":core-relocate-lettuce:shadowJar")
val task = project(":core-relocate-lettuce").tasks.shadowJar.get()
from(task.outputs.files.map {
if (it.isDirectory) it else zipTree(
it
)
})
destinationDirectory = rootProject.layout.buildDirectory destinationDirectory = rootProject.layout.buildDirectory
} }
} }