plugins { id 'maven-publish' } subprojects { apply plugin: 'java' apply plugin: 'maven-publish' sourceCompatibility = 1.8 targetCompatibility = 1.8 repositories { mavenLocal() mavenCentral() maven { url 'https://maven.fabricmc.net/' } } dependencies { implementation 'com.google.guava:guava:28.0-jre' implementation 'com.google.code.gson:gson:2.8.5' testImplementation 'junit:junit:4.+' testImplementation 'org.hamcrest:hamcrest-all:1.+' } group = 'cuchaz' version = '0.21.1' def buildNumber = System.getenv("BUILD_NUMBER") version = version + "+" + (buildNumber ? "build.$buildNumber" : "local") task sourcesJar(type: Jar, dependsOn: classes) { classifier = 'sources' from sourceSets.main.allSource } java { withSourcesJar() } publishing { publications { "$project.name"(MavenPublication) { groupId project.group artifactId project.name version project.version from components.java } } } } allprojects { publishing { repositories { mavenLocal() if (project.hasProperty('mavenPass')) { maven { url = "http://mavenupload.modmuss50.me/" credentials { username = "buildslave" password = project.getProperty('mavenPass') } } } } } }