plugins { id 'java' id 'com.github.johnrengelman.shadow' version '7.0.0' id 'maven-publish' } defaultTasks 'allJar' allprojects { apply plugin: 'java' group = 'com.leonardobishop' version = '3.13' sourceCompatibility = 17 targetCompatibility = 17 } task allJar( type: Jar, dependsOn: subprojects.tasks['build'] ) { if (project.findProperty('gitversion') == null || project.findProperty('gitversion') == 'true') { ext.gitCommitHash = 'git rev-parse --verify --short HEAD'.execute().text.trim() project.version = "${project.version}-${gitCommitHash}" subprojects.each { it.version = "${it.version}-${gitCommitHash}" } } subprojects.each { subproject -> from subproject.configurations.archives.allArtifacts.files.collect { zipTree(it) } } archiveBaseName = 'Quests' } artifacts { archives allJar } publishing { publications { maven(MavenPublication) { groupId = 'com.leonardobishop' artifactId = 'quests' version = project.version artifact allJar pom.withXml { asNode().dependencies.dependency.each { dep -> dep.parent().remove(dep) } } } } repositories { maven { credentials { username = project.findProperty('mavenUser') ?: System.getenv('MAVEN_USER') password = project.findProperty('mavenPassword') ?: System.getenv('MAVEN_PASSWORD') } url = "https://repo.leonardobishop.com/releases/" } } }