Customize pom for publication to Maven Central

This commit is contained in:
Chris Beams 2015-01-06 11:22:12 +01:00
parent 7452765d62
commit 04ba6c4ed7
No known key found for this signature in database
GPG Key ID: 3D214F8F5BC5ED73
1 changed files with 55 additions and 0 deletions

View File

@ -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"
}
}
}
}