You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
3.1 KiB
67 lines
3.1 KiB
// Maven side of things |
|
subprojects { |
|
apply plugin: 'maven' // Java plugin has to have been already applied for the conf2scope mappings to work |
|
apply plugin: 'signing' |
|
|
|
signing { |
|
required { gradle.taskGraph.hasTask(uploadMavenCentral) } |
|
sign configurations.archives |
|
} |
|
|
|
/** |
|
* Publishing to Maven Central example provided from http://jedicoder.blogspot.com/2011/11/automated-gradle-project-deployment-to.html |
|
* artifactory will execute uploadArchives to force generation of ivy.xml, and we don't want that to trigger an upload to maven |
|
* central, so using custom upload task. |
|
*/ |
|
task uploadMavenCentral(type:Upload, dependsOn: signArchives) { |
|
configuration = configurations.archives |
|
onlyIf { ['release', 'snapshot'].contains(project.status) } |
|
repositories.mavenDeployer { |
|
beforeDeployment { signing.signPom(it) } |
|
|
|
// To test deployment locally, use the following instead of oss.sonatype.org |
|
//repository(url: "file://localhost/${rootProject.rootDir}/repo") |
|
|
|
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2') { |
|
authentication(userName: rootProject.sonatypeUsername, password: rootProject.sonatypePassword) |
|
} |
|
|
|
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots/') { |
|
authentication(userName: rootProject.sonatypeUsername, password: rootProject.sonatypePassword) |
|
} |
|
|
|
// Prevent datastamp from being appending to artifacts during deployment |
|
uniqueVersion = false |
|
|
|
// Closure to configure all the POM with extra info, common to all projects |
|
pom.project { |
|
name "${project.name}" |
|
description "${project.name} developed by Netflix" |
|
developers { |
|
developer { |
|
id 'netflixgithub' |
|
name 'Netflix Open Source Development' |
|
email 'talent@netflix.com' |
|
} |
|
} |
|
licenses { |
|
license { |
|
name 'The Apache Software License, Version 2.0' |
|
url 'http://www.apache.org/licenses/LICENSE-2.0.txt' |
|
distribution 'repo' |
|
} |
|
} |
|
url "https://github.com/Netflix/${rootProject.githubProjectName}" |
|
scm { |
|
connection "scm:git:git@github.com:Netflix/${rootProject.githubProjectName}.git" |
|
url "scm:git:git@github.com:Netflix/${rootProject.githubProjectName}.git" |
|
developerConnection "scm:git:git@github.com:Netflix/${rootProject.githubProjectName}.git" |
|
} |
|
issueManagement { |
|
system 'github' |
|
url "https://github.com/Netflix/${rootProject.githubProjectName}/issues" |
|
} |
|
} |
|
} |
|
} |
|
}
|
|
|