-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaven.gradle
61 lines (57 loc) · 2.31 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
apply plugin: 'maven-publish'
apply plugin: 'signing'
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
groupId = config.lib.group_id //sonatype平台创建的groupId
artifactId = config.lib.name
version = config.lib.version //库版本名
project.ext["signing.keyId"] = config.key.id //GPG指纹后8位
project.ext["signing.password"] = config.key.pwd //GPG密码
project.ext["signing.secretKeyRingFile"] = config.key.path //GPG私钥
pom {
name = config.lib.name
description = config.lib.description
url = config.developer.url //github主页地址
licenses {
license {
name = config.license.name
url = config.license.url
}
}
developers {
developer { //填开发者信息
id = config.developer.id
name = config.developer.name
email = config.developer.email
}
}
scm {
connection = "scm:svn:$config.developer.url" //后面为github主页地址
developerConnection = "scm:svn:$config.developer.url" //后面为github主页地址
url = config.developer.url //github主页地址
}
}
}
}
repositories {
maven {
name = config.maven.name
//allowInsecureProtocol true
//url config.maven.release_url
credentials {
username = config.maven.username
password = config.maven.password
}
def releasesRepoUrl = config.maven.release_url
def snapshotsRepoUrl = config.maven.snapshot_url
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
}
project.signing {
sign project.publishing.publications
}
}