diff --git a/README.md b/README.md
index 32ffd80..3cbf936 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,7 @@
![ClaimChunk Title](imgs/logo_carrier.png)
[![Plugin Version](https://img.shields.io/static/v1?label=Version&message=0.0.24&color=blueviolet&style=for-the-badge)](https://github.com/cjburkey01/ClaimChunk/releases)
+[![Maven Central Version](https://img.shields.io/maven-central/v/com.cjburkey.claimchunk/claimchunk?label=Maven%20Central&color=blueviolet&style=for-the-badge)](https://central.sonatype.com/artifact/com.cjburkey.claimchunk/claimchunk)
[![Minecraft Version](https://img.shields.io/static/v1?label=Spigot&message=1.20.6&color=blueviolet&style=for-the-badge)](https://www.spigotmc.org/resources/claimchunk.44458/)
![Java Version](https://img.shields.io/static/v1?label=Java&message=17&color=blueviolet&style=for-the-badge)
[![Servers Using Claimchunk](https://img.shields.io/bstats/servers/5179?label=Servers&color=cornflowerblue&style=for-the-badge)](https://bstats.org/plugin/bukkit/ClaimChunk)
@@ -73,6 +74,30 @@ Here are some plugins that either have addons for or integrations with ClaimChun
* Archived: [*Pl3xMap*](https://github.com/pl3xgaming/Pl3xMap) via [this addon](https://github.com/pl3xgaming/Pl3xMap-ClaimChunk)
* (Old, maybe functional, repository deleted) [ClaimFly](https://www.spigotmc.org/resources/claimfly-claimchunk-addon-1-18-x.99189/) (allowing players to fly in claimed territory).
+Now on Maven Central! To make a plugin, use one of these snippets:
+
+Maven:
+
+```xml
+
+ com.cjburkey.claimchunk
+ claimchunk
+ 0.0.24
+
+```
+
+Gradle (Groovy):
+
+```groovy
+implementation 'com.cjburkey.claimchunk:claimchunk:0.0.24'
+```
+
+Gradle (Kotlin):
+
+```kotlin
+implementation("com.cjburkey.claimchunk:claimchunk:0.0.24")
+```
+
Building
--------
[![Automatic Build](https://img.shields.io/github/actions/workflow/status/cjburkey01/ClaimChunk/gradle.yml?branch=main&style=for-the-badge)](https://claimchunk.cjburkey.com/server/Downloads.html#snapshot-downloads)
diff --git a/build.gradle.kts b/build.gradle.kts
index 611ead0..18b8255 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,6 +1,7 @@
// I NEED THESE PLEASE
@file:Suppress("RedundantSemicolon")
+import com.vanniktech.maven.publish.SonatypeHost
import org.apache.tools.ant.filters.ReplaceTokens;
import de.undercouch.gradle.tasks.download.Download;
@@ -10,7 +11,8 @@ plugins {
id("de.undercouch.download") version "5.6.0";
id("io.freefair.lombok") version "8.6";
// Including dependencies in final jar
- id("com.github.johnrengelman.shadow") version "8.1.1";
+ //id("com.github.johnrengelman.shadow") version "8.1.1";
+ id("com.vanniktech.maven.publish") version "0.28.0";
}
object DepData {
@@ -86,7 +88,9 @@ tasks {
options.encoding = "UTF-8";
}
- shadowJar {
+ // We don't actually include any other libraries now
+ // (except smartcommanddispatcher, but we do that manually)
+ /*shadowJar {
// Set the jar name and version
archiveBaseName.set(DepData.ARCHIVES_BASE_NAME);
archiveClassifier.set("plugin");
@@ -104,7 +108,7 @@ tasks {
// Do the same with JALL
// relocate("io.github.goldmensch.jall",
// "claimchunk.dependency.io.github.goldmensch.jall");
- }
+ }*/
test {
useJUnitPlatform();
@@ -144,7 +148,7 @@ tasks {
// Fill in readme placeholders
register("updateReadme") {
- mustRunAfter("shadowJar", "build");
+ mustRunAfter("build");
description = "Expands tokens in the unbuilt readme file into the main readme file";
val inf = mainDir.file(DepData.README_IN);
@@ -208,30 +212,29 @@ tasks {
// Copy from the libs dir to the plugins directory in the testServerDir
register("copyClaimChunkToPluginsDir") {
- dependsOn("shadowJar");
mustRunAfter("copyClaimChunkToOutputDir");
description = "Copies ClaimChunk from the build directory to the test server plugin directory.";
- val inputFile = mainDir.file("build/libs/claimchunk-${project.version}-plugin.jar");
+ val inputFile = mainDir.file("build/libs/claimchunk-${project.version}.jar");
val outputDir = mainDir.dir("${DepData.TEST_SERVER_DIR}/plugins");
inputs.file(inputFile);
- outputs.file(outputDir.file("claimchunk-${project.version}-plugin.jar"));
+ outputs.file(outputDir.file("claimchunk-${project.version}.jar"));
- from(mainDir.file("build/libs/claimchunk-${project.version}-plugin.jar"));
+ from(mainDir.file("build/libs/claimchunk-${project.version}.jar"));
into(outputDir);
}
register("copyClaimChunkToOutputDir") {
- dependsOn("shadowJar");
+ // dependsOn("shadowJar");
mustRunAfter("updateReadme");
description = "Copies ClaimChunk from the build directory to the output directory.";
- val inputFile = mainDir.file("build/libs/claimchunk-${project.version}-plugin.jar");
+ val inputFile = mainDir.file("build/libs/claimchunk-${project.version}.jar");
val outputDir = mainDir.dir(DepData.OUTPUT_DIR);
inputs.file(inputFile);
- outputs.file(outputDir.file("claimchunk-${project.version}-plugin.jar"));
+ outputs.file(outputDir.file("claimchunk-${project.version}.jar"));
from(inputFile);
into(outputDir);
@@ -300,11 +303,81 @@ dependencies {
compileOnly("com.sk89q.worldguard:worldguard-bukkit:${DepData.WORLD_GUARD_BUKKIT_VERSION}");
compileOnly("me.clip:placeholderapi:${DepData.PLACEHOLDER_API_VERSION}");
- // Dependencies that needs to be shaded into the final jar
- // implementation("de.goldmensch:SmartCommandDispatcher:${DepData.SMART_COMMAND_DISPATCHER_VERSION}");
- // implementation("io.github.goldmensch:JALL:${DepData.JALL_I18N_VERSION}");
-
-
testImplementation("org.junit.jupiter:junit-jupiter:${DepData.JUNIT_VERSION}");
testRuntimeOnly("org.junit.platform:junit-platform-launcher:${DepData.JUNIT_LAUNCHER_VERSION}");
}
+
+
+// -- Publishing! -- //
+
+
+// https://vanniktech.github.io/gradle-maven-publish-plugin/central/
+mavenPublishing {
+ // publishing to https://central.sonatype.com/
+ publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
+
+ signAllPublications()
+
+ coordinates("com.cjburkey.claimchunk", DepData.ARCHIVES_BASE_NAME, DepData.THIS_VERSION)
+
+ pom {
+ name.set(DepData.PLUGIN_NAME)
+ description.set("Spigot/Paper plugin allowing players to claim chunks")
+ inceptionYear.set("2017")
+ url.set("https://github.com/cjburkey01/ClaimChunk")
+ licenses {
+ license {
+ name.set("MIT License")
+ url.set("https://github.com/cjburkey01/ClaimChunk/blob/main/LICENSE")
+ distribution.set("https://github.com/cjburkey01/ClaimChunk/blob/main/LICENSE")
+ }
+ }
+ developers {
+ developer {
+ id.set("cjburkey01")
+ name.set("CJ Burkey")
+ url.set("https://github.com/cjburkey01/")
+ }
+ developer {
+ id.set("Goldmensch")
+ name.set("Goldmensch")
+ url.set("https://github.com/Goldmensch")
+ }
+ developer {
+ id.set("DeathsGun")
+ name.set("DeathsGun")
+ url.set("https://github.com/DeathsGun")
+ }
+ developer {
+ id.set("T0biii")
+ name.set("T0biii")
+ url.set("https://github.com/T0biii")
+ }
+ developer {
+ id.set("Geolykt")
+ name.set("Geolykt")
+ url.set("https://github.com/Geolykt")
+ }
+ developer {
+ id.set("JustDoom")
+ name.set("JustDoom")
+ url.set("https://github.com/JustDoom")
+ }
+ developer {
+ id.set("AlexFF000")
+ name.set("AlexFF000")
+ url.set("https://github.com/AlexFF000")
+ }
+ developer {
+ id.set("18PatZ")
+ name.set("18PatZ")
+ url.set("https://github.com/18PatZ")
+ }
+ }
+ scm {
+ url.set("https://github.com/cjburkey01/ClaimChunk")
+ connection.set("scm:git:git://github.com/cjburkey01/ClaimChunk.git")
+ developerConnection.set("scm:git:ssh://git@github.com/cjburkey01/ClaimChunk.git")
+ }
+ }
+}
diff --git a/unbuilt_readme.md b/unbuilt_readme.md
index 1447023..36eb36a 100644
--- a/unbuilt_readme.md
+++ b/unbuilt_readme.md
@@ -2,6 +2,7 @@
![ClaimChunk Title](imgs/logo_carrier.png)
[![Plugin Version](https://img.shields.io/static/v1?label=Version&message=@LIVE_VERSION@&color=blueviolet&style=for-the-badge)](https://github.com/cjburkey01/ClaimChunk/releases)
+[![Maven Central Version](https://img.shields.io/maven-central/v/com.cjburkey.claimchunk/claimchunk?label=Maven%20Central&color=blueviolet&style=for-the-badge)](https://central.sonatype.com/artifact/com.cjburkey.claimchunk/claimchunk)
[![Minecraft Version](https://img.shields.io/static/v1?label=Spigot&message=@LATEST_MC_VERSION@&color=blueviolet&style=for-the-badge)](https://www.spigotmc.org/resources/claimchunk.44458/)
![Java Version](https://img.shields.io/static/v1?label=Java&message=@JAVA_VERSION@&color=blueviolet&style=for-the-badge)
[![Servers Using Claimchunk](https://img.shields.io/bstats/servers/5179?label=Servers&color=cornflowerblue&style=for-the-badge)](https://bstats.org/plugin/bukkit/ClaimChunk)
@@ -73,6 +74,30 @@ Here are some plugins that either have addons for or integrations with ClaimChun
* Archived: [*Pl3xMap*](https://github.com/pl3xgaming/Pl3xMap) via [this addon](https://github.com/pl3xgaming/Pl3xMap-ClaimChunk)
* (Old, maybe functional, repository deleted) [ClaimFly](https://www.spigotmc.org/resources/claimfly-claimchunk-addon-1-18-x.99189/) (allowing players to fly in claimed territory).
+Now on Maven Central! To make a plugin, use one of these snippets:
+
+Maven:
+
+```xml
+
+ com.cjburkey.claimchunk
+ claimchunk
+ @LIVE_VERSION@
+
+```
+
+Gradle (Groovy):
+
+```groovy
+implementation 'com.cjburkey.claimchunk:claimchunk:@LIVE_VERSION@'
+```
+
+Gradle (Kotlin):
+
+```kotlin
+implementation("com.cjburkey.claimchunk:claimchunk:@LIVE_VERSION@")
+```
+
Building
--------
[![Automatic Build](https://img.shields.io/github/actions/workflow/status/cjburkey01/ClaimChunk/gradle.yml?branch=main&style=for-the-badge)](https://claimchunk.cjburkey.com/server/Downloads.html#snapshot-downloads)