mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-12-22 20:47:57 +01:00
gradle: add support for custom repo to publish to
And introduce useSonatype setting to skip the sonatype repos if desired.
This commit is contained in:
parent
ea944a8dc6
commit
398cba330b
1 changed files with 24 additions and 3 deletions
27
build.gradle
27
build.gradle
|
@ -134,6 +134,12 @@ allprojects {
|
|||
junitVersion = '5.6.0'
|
||||
powerMockVersion = '2.0.2'
|
||||
commonsIoVersion = '2.6'
|
||||
if (project.hasProperty("useSonatype")) {
|
||||
useSonatype = project.getProperty("useSonatype").toBoolean()
|
||||
} else {
|
||||
// Default to true
|
||||
useSonatype = true
|
||||
}
|
||||
}
|
||||
group = 'org.igniterealtime.smack'
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
|
@ -457,15 +463,30 @@ subprojects {
|
|||
}
|
||||
}
|
||||
repositories {
|
||||
maven {
|
||||
url isSnapshot ? sonatypeSnapshotUrl : sonatypeStagingUrl
|
||||
if (sonatypeCredentialsAvailable) {
|
||||
if (sonatypeCredentialsAvailable && useSonatype) {
|
||||
maven {
|
||||
url isSnapshot ? sonatypeSnapshotUrl : sonatypeStagingUrl
|
||||
credentials {
|
||||
username = sonatypeUsername
|
||||
password = sonatypePassword
|
||||
}
|
||||
}
|
||||
}
|
||||
// Use
|
||||
// gradle publish -P customRepoUrl=https://www.igniterealtime.org/archiva/repository/maven -P customRepoUsername=bamboo -P customRepoPassword=hidden -P useSonatype=false
|
||||
// to deploy to this repo.
|
||||
if (project.hasProperty("customRepoUrl")) {
|
||||
maven {
|
||||
name 'customRepo'
|
||||
url customRepoUrl
|
||||
if (project.hasProperty("customRepoUsername")) {
|
||||
credentials {
|
||||
username customRepoUsername
|
||||
password customRepoPassword
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
rootProject.distributionZip {
|
||||
|
|
Loading…
Reference in a new issue