Add support for proxy maven deployment
Summary: This is helpful when uploading snapshots from a devserver. Reviewed By: priteshrnandgaonkar Differential Revision: D10008434 fbshipit-source-id: de00acee189e751982f622c0ac317e9c2ea14540
This commit is contained in:
committed by
Facebook Github Bot
parent
90cf003035
commit
9685477ea6
@@ -41,6 +41,16 @@ def getRepositoryPassword() {
|
|||||||
return hasProperty('SONATYPE_NEXUS_PASSWORD') ? SONATYPE_NEXUS_PASSWORD : ""
|
return hasProperty('SONATYPE_NEXUS_PASSWORD') ? SONATYPE_NEXUS_PASSWORD : ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def applyProxy(repo) {
|
||||||
|
def host = System.getProperty('https.proxyHost')
|
||||||
|
def port = (System.getProperty('https.proxyPort') ?: '-1').toInteger()
|
||||||
|
|
||||||
|
if (host != null && port > 0) {
|
||||||
|
repo.proxy(host: host, port: port, type: 'http')
|
||||||
|
repo.proxy(host: host, port: port, type: 'https')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
afterEvaluate { project ->
|
afterEvaluate { project ->
|
||||||
uploadArchives {
|
uploadArchives {
|
||||||
repositories {
|
repositories {
|
||||||
@@ -53,9 +63,11 @@ afterEvaluate { project ->
|
|||||||
|
|
||||||
repository(url: getReleaseRepositoryUrl()) {
|
repository(url: getReleaseRepositoryUrl()) {
|
||||||
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
|
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
|
||||||
|
applyProxy(it)
|
||||||
}
|
}
|
||||||
snapshotRepository(url: getSnapshotRepositoryUrl()) {
|
snapshotRepository(url: getSnapshotRepositoryUrl()) {
|
||||||
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
|
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
|
||||||
|
applyProxy(it)
|
||||||
}
|
}
|
||||||
|
|
||||||
pom.project {
|
pom.project {
|
||||||
|
|||||||
Reference in New Issue
Block a user