plugins { id 'java' } group 'cn.hamster3.plugin' version '1.0.0' subprojects { apply plugin: 'java-library' apply plugin: 'maven-publish' group = rootProject.group version = rootProject.version repositories { maven { url = "https://maven.airgame.net/maven-public/" } } configurations { api.extendsFrom apiShade implementation.extendsFrom implementationShade } dependencies { compileOnly group: 'org.jetbrains', name: 'annotations', version: '21.0.1' } tasks.withType(JavaCompile) { options.setEncoding("UTF-8") } tasks.withType(Jar) { from([rootProject.file("LICENSE")]) duplicatesStrategy(DuplicatesStrategy.EXCLUDE) } java { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 // withJavadocJar() withSourcesJar() } publishing { publications { mavenJava(MavenPublication) { from project.components.java } } repositories { maven { def releasesRepoUrl = 'https://maven.airgame.net/maven-releases/' def snapshotsRepoUrl = 'https://maven.airgame.net/maven-snapshots/' url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl credentials { username rootProject.properties.getOrDefault("maven_username", "") password rootProject.properties.getOrDefault("maven_password", "") } } } } }