-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaven-push.gradle
60 lines (52 loc) · 2.43 KB
/
maven-push.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
apply plugin: 'maven'
apply plugin: 'signing'
Properties properties = new Properties()
try {
properties.load(project.rootProject.file('uploadMaven').newDataInputStream())
} catch (FileNotFoundException ignore) {}
afterEvaluate { project ->
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
pom.groupId = properties.getProperty('GROUP')
pom.artifactId = properties.getProperty('POM_ARTIFACT_ID')
pom.version = properties.getProperty('VERSION_NAME')
repository(url: properties.getProperty('RELEASE_REPOSITORY_URL')) {
authentication(userName: properties.getProperty('NEXUS_USERNAME'), password: properties.getProperty('NEXUS_PASSWORD'))
}
snapshotRepository(url: properties.getProperty('SNAPSHOT_REPOSITORY_URL')) {
authentication(userName: properties.getProperty('NEXUS_USERNAME'), password: properties.getProperty('NEXUS_PASSWORD'))
}
pom.project {
name properties.getProperty('POM_NAME')
packaging properties.getProperty('POM_PACKAGING')
description properties.getProperty('POM_DESCRIPTION')
url properties.getProperty('POM_URL')
scm {
url 'https://github.com/tatsuyuki25/AsyncTask'
connection properties.getProperty('POM_SCM_CONNECTION')
developerConnection properties.getProperty('POM_SCM_DEV_CONNECTION')
}
licenses {
license {
name properties.getProperty('POM_LICENCE_NAME')
url properties.getProperty('POM_LICENCE_URL')
distribution properties.getProperty('POM_LICENCE_DIST')
}
}
developers {
developer {
id properties.getProperty('POM_DEVELOPER_ID')
name properties.getProperty('POM_DEVELOPER_NAME')
}
}
}
}
}
}
signing {
required { gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
}