import org.gradle.api.artifacts.maven.MavenDeployment apply plugin: 'groovy' apply plugin: 'maven' apply plugin: 'signing' dependencies { compile gradleApi() compile localGroovy() } task sourcesJar(type: Jar) { from sourceSets.main.allSource classifier = 'sources' archiveName = archiveName.toLowerCase() } jar { archiveName = archiveName.toLowerCase() } task javadocJar(type: Jar, dependsOn: groovydoc) { from 'build/docs/groovydoc' classifier = 'javadoc' archiveName = archiveName.toLowerCase() } artifacts { archives jar archives javadocJar archives sourcesJar } if (hasProperty('sonatypeUsername')) { signing { sign configurations.archives } uploadArchives { repositories { mavenDeployer { beforeDeployment { MavenDeployment deployment -> signPom(deployment) } repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { authentication(userName: sonatypeUsername, password: sonatypePassword) } pom { project { name 'CompileOnlyPlugin' packaging 'jar' description 'Adds a compile only configuration to the Java plugin of Gradle' url 'http://coders-kitchen.github.com' scm { url 'scm:git@github:CodersKitchen/CompileOnlyPlugin.git' connection 'scm:git@github:CodersKitchen/CompileOnlyPlugin.git' developerConnection 'scm:git@github:CodersKitchen/CompileOnlyPlugin.git' } licenses { license { name 'The MIT License (MIT)' url 'http://opensource.org/licenses/MIT' distribution 'repo' } } developers { developer { id 'peterdaum' name 'Peter Daum' } } } artifactId = project.name.toLowerCase() } } } } }