From 04ba6c4ed7f7251cd33eb94941dee170ba1f60b0 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Tue, 6 Jan 2015 11:22:12 +0100 Subject: [PATCH] Customize pom for publication to Maven Central --- ethereumj-core/build.gradle | 55 +++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/ethereumj-core/build.gradle b/ethereumj-core/build.gradle index d1f5304a..7475de73 100644 --- a/ethereumj-core/build.gradle +++ b/ethereumj-core/build.gradle @@ -171,7 +171,62 @@ bintrayUpload.onlyIf { (!pullRequest || pullRequest == 'false') && !project.version.endsWith('-SNAPSHOT') } +install { + repositories.mavenInstaller { + customizePom(pom, project) + } +} + publish { description = "Releases snapshots to oss.jfrog.org and releases to Bintray/JCenter" dependsOn artifactoryPublish, bintrayUpload } + + +def customizePom(pom, gradleProject) { + pom.whenConfigured { generatedPom -> + // eliminate test-scoped dependencies (no need in maven central poms) + generatedPom.dependencies.removeAll { dep -> + dep.scope == "test" + } + + // 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 = "ethereumj" + description = "Java implementation of the Ethereum protocol" + url = "https://github.com/ethereum/ethereumj" + organization { + name = "Ethereum" + url = "https://ethereum.org" + } + licenses { + license { + name "The MIT License" + url "http://mit-license.org/" + distribution "repo" + } + } + scm { + url = "https://github.com/ethereum/ethereumj" + connection = "scm:git:git://github.com/ethereum/ethereumj" + developerConnection = "scm:git:git://github.com/ethereum/ethereumj" + } + developers { + developer { + id = "rmandeleil" + name = "Roman Mandeleil" + email = "roman.mandeleil@gmail.com" + } + } + issueManagement { + system = "GitHub Issues" + url = "https://github.com/ethereum/ethereumj/issues" + } + } + } +}