diff --git a/Paper-MojangAPI/build.gradle.kts b/Paper-MojangAPI/build.gradle.kts index 536b4577cf..0fdb8a028b 100644 --- a/Paper-MojangAPI/build.gradle.kts +++ b/Paper-MojangAPI/build.gradle.kts @@ -1,5 +1,6 @@ plugins { `java-library` + `maven-publish` } java { @@ -23,3 +24,9 @@ dependencies { testImplementation("org.hamcrest:hamcrest-library:1.3") testImplementation("org.ow2.asm:asm-tree:7.3.1") } + +configure { + publications.create("maven") { + from(components["java"]) + } +} diff --git a/patches/api/Convert-project-to-Gradle.patch b/patches/api/Convert-project-to-Gradle.patch index df4d4267c6..7080f250f5 100644 --- a/patches/api/Convert-project-to-Gradle.patch +++ b/patches/api/Convert-project-to-Gradle.patch @@ -24,6 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + +plugins { + `java-library` ++ `maven-publish` +} + +java { @@ -52,6 +53,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + testImplementation("org.ow2.asm:asm-tree:9.1") +} + ++configure { ++ publications.create("maven") { ++ from(components["java"]) ++ } ++} ++ +val generateApiVersioningFile by tasks.registering { + val pomProps = layout.buildDirectory.file("pom.properties") + outputs.file(pomProps) diff --git a/patches/server/Build-system-changes.patch b/patches/server/Build-system-changes.patch index a0c95d1abe..5d31f9fa99 100644 --- a/patches/server/Build-system-changes.patch +++ b/patches/server/Build-system-changes.patch @@ -47,9 +47,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 )) for (tld in listOf("net", "com", "org")) { attributes(mapOf( -@@ -0,0 +0,0 @@ tasks.jar { +@@ -0,0 +0,0 @@ configure { + } + } ++val generatePom = tasks.named("generatePomFileForMavenPublication") ++ tasks.shadowJar { ++ // Needed for Paperclip's install to maven local feature ++ from(generatePom) { ++ into("META-INF/maven/io.papermc.paper/paper") ++ rename { "pom.xml" } ++ } ++ listOf( - "jline", "it.unimi", "org.apache.commons.codec", "org.apache.commons.io", + "jline", "org.apache.commons.codec", "org.apache.commons.io", // Paper - don't relocate fastutil diff --git a/patches/server/Setup-Gradle-project.patch b/patches/server/Setup-Gradle-project.patch index 1ff6aef8a7..e047d94701 100644 --- a/patches/server/Setup-Gradle-project.patch +++ b/patches/server/Setup-Gradle-project.patch @@ -21,7 +21,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +0,0 @@ -+import com.github.jengelman.gradle.plugins.shadow.transformers.AppendingTransformer +import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer +import com.github.jengelman.gradle.plugins.shadow.transformers.Transformer +import io.papermc.paperweight.util.Git @@ -33,6 +32,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + +plugins { + java ++ `maven-publish` + id("com.github.johnrengelman.shadow") +} + @@ -86,6 +86,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } +} + ++configure { ++ publications.create("maven") { ++ // todo: confirm this is correct ++ from(components["java"]) ++ artifact(tasks.reobfJar) { ++ classifier = "reobf" ++ } ++ } ++} ++ +tasks.shadowJar { + listOf( + "jline", "it.unimi", "org.apache.commons.codec", "org.apache.commons.io",