plugins { id("java") id("maven-publish") id("com.github.johnrengelman.shadow") version "8+" } group = "cn.hamster3.mc.plugin" version = "1.2.0-SNAPSHOT" subprojects { apply { plugin("java-library") plugin("maven-publish") plugin("com.github.johnrengelman.shadow") } group = rootProject.group version = rootProject.version repositories { maven { url = uri("https://maven.airgame.net/maven-public/") } } dependencies { compileOnly("org.jetbrains:annotations:+") compileOnly("org.projectlombok:lombok:+") annotationProcessor("org.projectlombok:lombok:+") } java { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 withSourcesJar() } tasks { withType { options.encoding = "UTF-8" } withType { from(rootProject.file("LICENSE")) duplicatesStrategy = DuplicatesStrategy.EXCLUDE } shadowJar { relocate("io.netty", "cn.hamster3.mc.plugin.ball.lib.io.netty") relocate("io.lettuce", "cn.hamster3.mc.plugin.ball.lib.io.lettuce") relocate("org.reactivestreams", "cn.hamster3.mc.plugin.ball.lib.org.reactivestreams") relocate("reactor", "cn.hamster3.mc.plugin.ball.lib.reactor") destinationDirectory = rootProject.buildDir } build { dependsOn(shadowJar) } } publishing { publications { create("mavenJava") { from(components["java"]) } } repositories { maven { url = uri("https://maven.airgame.net/maven-airgame") credentials { username = rootProject.properties.getOrDefault("maven_username", "").toString() password = rootProject.properties.getOrDefault("maven_password", "").toString() } } } } }