-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathnexusConfig.gradle
41 lines (35 loc) · 1.36 KB
/
nexusConfig.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
34
35
36
37
38
39
40
41
Properties properties = new Properties()
if (project.rootProject.file('gradle.properties').canRead()) {
properties.load(project.rootProject.file("gradle.properties").newDataInputStream())
}
// Default parameters
ext.nexusUrl = properties.getProperty("nexusUrl", "file:///tmp/sdkRepo")
ext.nexusUsername = properties.getProperty("nexusUsername", "")
ext.nexusPassword = properties.getProperty("nexusPassword", "")
ext.nexusRelease = "${nexusUrl}/service/local/staging/deploy/maven2/"
ext.nexusSnapshot = "${nexusUrl}/content/repositories/snapshots/"
private boolean signingConfigured() {
return project.hasProperty("signing.keyId") \
&& project.hasProperty("signing.password") \
&& project.hasProperty("signing.secretKeyRingFile")
}
allprojects {
apply plugin: 'maven'
if (signingConfigured()) {
apply plugin: 'signing'
signing {
sign configurations.archives
}
}
uploadArchives.repositories.mavenDeployer {
if (signingConfigured()) {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
}
repository(url: nexusRelease) {
authentication(userName: nexusUsername, password: nexusPassword)
}
snapshotRepository(url: nexusSnapshot) {
authentication(userName: nexusUsername, password: nexusPassword)
}
}
}