-
Notifications
You must be signed in to change notification settings - Fork 14
/
nexus-publish.gradle
33 lines (28 loc) · 1.34 KB
/
nexus-publish.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
apply from: rootProject.file('publishing.gradle')
group = getPublishProperty('groupId')
nexusPublishing {
repositories {
sonatype {
def ossrhUsername, ossrhPassword, sonatypeStagingProfileId = ''
if (System.getenv().containsKey('CI')) {
ossrhUsername = System.getenv('OSSRH_USERNAME')
ossrhPassword = System.getenv('OSSRH_PASSWORD')
sonatypeStagingProfileId = System.getenv('SONATYPE_STAGING_PROFILE_ID')
} else {
File secretPropsFile = project.rootProject.file('local.properties')
Properties properties = new Properties()
try(def input = secretPropsFile.newDataInputStream()) {
properties.load(input)
}
ossrhUsername = properties.getProperty("ossrhUsername")
ossrhPassword = properties.getProperty("ossrhPassword")
sonatypeStagingProfileId = properties.getProperty("sonatypeStagingProfileId")
}
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
username = ossrhUsername
password = ossrhPassword
stagingProfileId = sonatypeStagingProfileId
}
}
}