task sonaTypeUpload(type: Upload) { configuration = configurations.archives uploadDescriptor = true repositories { if (project.hasProperty('ossrhUsername')) { mavenDeployer { beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2') { authentication(userName: ossrhUsername, password: ossrhPassword) } snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots') { authentication(userName: ossrhUsername, password: ossrhPassword) } pom.project { groupId project.group artifactId project.name version project.version name project.name description description packaging 'jar' inceptionYear '2016' url scmUrl organization { name 'xbib' url 'http://xbib.org' } developers { developer { id user name 'Jörg Prante' email 'joergprante@gmail.com' url 'https://github.com/jprante' } } scm { url scmUrl connection scmConnection developerConnection scmDeveloperConnection } licenses { license { name 'BSD 3-Clause License' url 'https://opensource.org/licenses/BSD-3-Clause' } } } } } } }