-
Notifications
You must be signed in to change notification settings - Fork 390
/
Copy pathmaven.gradle
74 lines (66 loc) · 2.77 KB
/
maven.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
apply plugin: 'maven-publish'
apply plugin: 'signing'
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
ext."signing.keyId" = properties.getProperty("signing.keyId")
ext."signing.password" = properties.getProperty("signing.password")
ext."signing.secretKeyRingFile" = properties.getProperty("signing.secretKeyRingFile")
group = "com.tencent.vasdolly"
version = project.rootProject.VERSION
// Because the components are created only during the afterEvaluate phase, you must
// configure your publications using the afterEvaluate() lifecycle method.
afterEvaluate {
publishing {
publications {
// Creates a Maven publication called "vasdollyRelease".
vasdollyRelease(MavenPublication) {
groupId = "com.tencent.vasdolly"
artifactId = POM_ARTIFACT_ID
version = project.rootProject.VERSION
if (POM_PACKAGING == "aar") {
from components.release
} else {
from components.java
}
pom {
name = POM_NAME
artifactId = POM_ARTIFACT_ID
packaging = POM_PACKAGING
scm {
connection = "https://github.com/Tencent/VasDolly.git"
developerConnection = "https://github.com/Tencent/VasDolly.git"
url = "https://github.com/Tencent/VasDolly"
}
developers {
developer { //developer info
id = 'leon'
name = 'leon'
email = 'ltlovezh@gmail.com'
}
developer { //developer info
id = 'yanyongshan'
name = 'yanyongshan'
email = 'wecityyan@tencent.com'
}
}
}
}
}
//发布仓库
//仓库地址:https://repo.maven.apache.org/maven2/com/tencent/vasdolly/
repositories {
maven {
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = properties.getProperty("ossrhUsername")
password = properties.getProperty("ossrhPassword")
}
}
}
}
signing {
sign publishing.publications.vasdollyRelease
}
}