2024-09-23 00:54:16 +08:00
|
|
|
plugins {
|
|
|
|
id("java")
|
2024-09-23 15:04:56 +08:00
|
|
|
id("maven-publish")
|
2024-09-23 00:54:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
java {
|
2024-10-09 14:45:59 +08:00
|
|
|
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
2024-10-10 15:21:19 +08:00
|
|
|
withJavadocJar()
|
|
|
|
withSourcesJar()
|
2024-09-23 00:54:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// utf-8
|
|
|
|
tasks.withType<JavaCompile> {
|
|
|
|
options.encoding = "UTF-8"
|
|
|
|
}
|
|
|
|
|
2024-10-10 15:21:19 +08:00
|
|
|
tasks.withType<Javadoc> {
|
|
|
|
options.encoding = "UTF-8"
|
2024-09-23 15:04:56 +08:00
|
|
|
}
|
|
|
|
|
2024-10-10 15:21:19 +08:00
|
|
|
dependencies {
|
|
|
|
compileOnly("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT")
|
2024-10-08 10:28:49 +08:00
|
|
|
}
|
|
|
|
|
2024-09-23 15:04:56 +08:00
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
create<MavenPublication>("mavenJava") {
|
|
|
|
groupId = "cn.lunadeer"
|
|
|
|
artifactId = "DominionAPI"
|
2024-10-11 11:06:01 +08:00
|
|
|
version = "2.1-SNAPSHOT"
|
|
|
|
// Add only the necessary artifacts manually to avoid conflicts
|
|
|
|
artifact(tasks.jar.get()) // The main JAR file without classifier
|
|
|
|
artifact(tasks.named<Jar>("sourcesJar").get()) {
|
|
|
|
classifier = "sources"
|
|
|
|
}
|
|
|
|
artifact(tasks.named<Jar>("javadocJar").get()) {
|
|
|
|
classifier = "javadoc"
|
|
|
|
}
|
2024-09-23 15:04:56 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
repositories {
|
|
|
|
maven {
|
|
|
|
url = uri("https://ssl.lunadeer.cn:14454/repository/maven-snapshots/")
|
|
|
|
credentials {
|
|
|
|
// from m2 settings.xml
|
|
|
|
username = project.findProperty("nexusUsername")?.toString()
|
|
|
|
password = project.findProperty("nexusPassword")?.toString()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|