diff --git a/build.gradle b/build.gradle index d2fb8d36..338df543 100644 --- a/build.gradle +++ b/build.gradle @@ -47,6 +47,7 @@ subprojects { apply plugin: 'propdeps-eclipse' apply plugin: 'propdeps-maven' apply plugin: 'maven' + apply from: "${rootProject.projectDir}/gradle/publish-maven.gradle" sourceCompatibility = 1.7 targetCompatibility = 1.7 diff --git a/gradle/publish-maven.gradle b/gradle/publish-maven.gradle new file mode 100644 index 00000000..ad2d7505 --- /dev/null +++ b/gradle/publish-maven.gradle @@ -0,0 +1,45 @@ +install { + repositories.mavenInstaller { + customizePom(pom, project) + } +} + +def customizePom(pom, gradleProject) { + pom.whenConfigured { generatedPom -> + generatedPom.dependencies.removeAll { dep -> + dep.scope == "test" + } + generatedPom.project { + name = gradleProject.description + description = gradleProject.description + url = "https://github.com/spring-projects/spring-restdocs" + organization { + name = "Spring IO" + url = "http://projects.spring.io/spring-restdocs" + } + licenses { + license { + name "The Apache Software License, Version 2.0" + url "http://www.apache.org/licenses/LICENSE-2.0.txt" + distribution "repo" + } + } + scm { + url = "https://github.com/spring-projects/spring-restdocs" + connection = "scm:git:git://github.com/spring-projects/spring-restdocs" + developerConnection = "scm:git:git://github.com/spring-projects/spring-restdocs" + } + developers { + developer { + id = "awilkinson" + name = "Andy Wilkinson" + email = "awilkinson@pivotal.io" + } + } + issueManagement { + system = "GitHub" + url = "https://github.com/spring-projects/spring-restdocs/issues" + } + } + } +} \ No newline at end of file