Fix publishing

This commit is contained in:
Telesphoreo 2022-04-12 16:37:10 -05:00
parent 0ebb2b8fae
commit dfb13d5185

View File

@ -1,15 +1,13 @@
import java.nio.charset.StandardCharsets
plugins { plugins {
id "java" id "java"
id "maven-publish"
id "net.minecrell.plugin-yml.bukkit" version "0.6.1-SNAPSHOT" id "net.minecrell.plugin-yml.bukkit" version "0.6.1-SNAPSHOT"
id 'com.github.johnrengelman.shadow' version '7.1.2' id 'com.github.johnrengelman.shadow' version '7.1.2'
id "maven-publish"
} }
group = "me.totalfreedom" group = "me.totalfreedom"
version = "4.8"
description = "BukkitTelnet" description = "BukkitTelnet"
version = "4.8-SNAPSHOT"
repositories { repositories {
mavenCentral() mavenCentral()
@ -39,19 +37,14 @@ tasks {
jar { jar {
dependsOn(shadowJar) dependsOn(shadowJar)
} }
compileJava { }
options.encoding = StandardCharsets.UTF_8.name() // We want UTF-8 for everything
// Set the release flag. This configures what version bytecode the compiler will emit, as well as what JDK APIs are usable. java {
// See https://openjdk.java.net/jeps/247 for more information. toolchain.languageVersion.set(JavaLanguageVersion.of(17))
options.release.set(17) }
}
javadoc { tasks.withType(JavaCompile) {
options.encoding = StandardCharsets.UTF_8.name() // We want UTF-8 for everything options.encoding = "UTF-8"
}
processResources {
filteringCharset = StandardCharsets.UTF_8.name() // We want UTF-8 for everything
}
} }
bukkit { bukkit {
@ -74,18 +67,29 @@ publishing {
def config = configurations.getByName("library") def config = configurations.getByName("library")
publications { publications {
maven(MavenPublication) { maven(MavenPublication) {
groupId = 'me.totalfreedom'
artifactId = 'BukkitTelnet'
version = rootProject.version
pom.withXml { pom.withXml {
def dependenciesNode = asNode().appendNode("dependencies")
config.getAllDependencies().each { dependency -> config.getAllDependencies().each { dependency ->
asNode().dependencies[0].appendNode("dependency").with { dependenciesNode.appendNode("dependency").with {
it.appendNode("groupId", dependency.group) it.appendNode("groupId", dependency.group)
it.appendNode("artifactId", dependency.name) it.appendNode("artifactId", dependency.name)
it.appendNode("version", dependency.version) it.appendNode("version", dependency.version)
it.appendNode("scope", "provided") it.appendNode("scope", "provided")
} }
} }
configurations.getByName("compileOnly").getAllDependencies().each { dependency ->
dependenciesNode.appendNode("dependency").with {
it.appendNode("groupId", dependency.group)
it.appendNode("artifactId", dependency.name)
it.appendNode("version", dependency.version)
it.appendNode("scope", "provided")
}
}
artifacts = [shadowJar]
} }
from(components.java)
artifacts = [shadowJar]
} }
} }
repositories { repositories {
@ -97,4 +101,4 @@ publishing {
} }
} }
} }
} }