diff --git a/build.gradle b/build.gradle index 62bda46..5826d79 100644 --- a/build.gradle +++ b/build.gradle @@ -12,6 +12,7 @@ allprojects { subprojects { apply plugin: 'java' apply plugin: 'eclipse' + apply from: "$rootDir/gradle/publish-maven.gradle" sourceCompatibility = 1.6 targetCompatibility = 1.6 diff --git a/gradle/publish-maven.gradle b/gradle/publish-maven.gradle new file mode 100644 index 0000000..ab27721 --- /dev/null +++ b/gradle/publish-maven.gradle @@ -0,0 +1,50 @@ +apply plugin: "maven" + +install { + repositories.mavenInstaller { + customizePom(pom, project) + } +} + +def customizePom(pom, gradleProject) { + pom.whenConfigured { generatedPom -> + // sort to make pom dependencies order consistent to ease comparison of older poms + generatedPom.dependencies = generatedPom.dependencies.sort { dep -> + "$dep.scope:$dep.groupId:$dep.artifactId" + } + + // add all items necessary for maven central publication + generatedPom.project { + name = gradleProject.description + description = gradleProject.description + url = "https://github.com/spring-projects/spring-loaded" + organization { + name = "Spring IO" + url = "http://projects.spring.io/spring-loaded" + } + 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-loaded" + connection = "scm:git:git://github.com/spring-projects/spring-loaded" + developerConnection = "scm:git:git://github.com/spring-projects/spring-loaded" + } + developers { + developer { + id = "aclement" + name = "Andy Clement" + email = "aclement@gopivotal.com" + } + } + issueManagement { + system = "GitHub" + url = "https://github.com/spring-projects/spring-loaded/issues" + } + } + } +}