plugins { id("java") id("maven-publish") id("com.github.johnrengelman.shadow") version "8+" } group = "cn.hamster3.mc.plugin" version = "1.1.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 { implementation("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("org.yaml", "cn.hamster3.mc.plugin.ball.lib.org.yaml") destinationDirectory = rootProject.buildDir } build { dependsOn(shadowJar) } } publishing { publications { create("mavenJava") { from(components["java"]) } } repositories { maven { val releasesRepoUrl = uri("https://maven.airgame.net/maven-releases/") val snapshotsRepoUrl = uri("https://maven.airgame.net/maven-snapshots/") url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl credentials { username = rootProject.properties.getOrDefault("maven_username", "").toString() password = rootProject.properties.getOrDefault("maven_password", "").toString() } } } } }