-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathpublish.gradle
More file actions
113 lines (94 loc) · 3.58 KB
/
publish.gradle
File metadata and controls
113 lines (94 loc) · 3.58 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/**
* Maven publishing configuration
* */
// Maven pom.xml attributes
ext {
libraryName = 'Testerra'
libraryDescription = "Testerra test automation framework"
siteUrl = 'https://testerra.io'
gitUrl = 'scm:git:git://github.com/telekom/testerra.git'
gitHttpsUrl = 'https://github.com/telekom/testerra'
developerId = 'MMS'
developerName = 'Testerra Team MMS'
developerEmail = '[email protected]'
developerOrganization = 'Deutsche Telekom MMS GmbH'
developerOrganizationUrl = 'https://www.telekom-mms.com/'
licenseName = 'The Apache Software License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
allLicenses = ["Apache-2.0"]
}
allprojects {
javadoc {
// Support JDK 8 annotations
options.tags = [
"implNote:a:Implementation Note:",
"apiNote:a:API Note:",
"implSpec:a:Implementation Requirements:"
]
// Prevent errors during generation
options.addStringOption('Xdoclint:none', '-quiet')
}
artifacts {
archives sourcesJar
archives javadocJar
}
publishOnCentral {
projectDescription.set(rootProject.ext.libraryDescription)
projectLongName.set(project.name)
licenseName.set(rootProject.ext.licenseName)
licenseUrl.set(rootProject.ext.licenseUrl)
projectUrl.set(rootProject.ext.gitHttpsUrl)
scmConnection.set(rootProject.ext.gitUrl)
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
// Custom pom
pom {
name = rootProject.ext.libraryName
description = rootProject.ext.libraryDescription
url = rootProject.ext.siteUrl
licenses {
license {
name = rootProject.ext.licenseName
url = rootProject.ext.licenseUrl
}
}
developers {
developer {
id = rootProject.ext.developerId
name = rootProject.ext.developerName
email = rootProject.ext.developerEmail
organization = rootProject.ext.developerOrganization
organizationUrl = rootProject.ext.developerOrganizationUrl
}
}
scm {
connection = rootProject.ext.gitUrl
developerConnection = rootProject.ext.gitUrl
url = rootProject.ext.gitHttpsUrl
}
}
}
}
if (project.version.endsWith("-SNAPSHOT")) {
repositories {
maven {
url "https://central.sonatype.com/repository/maven-snapshots/"
credentials {
username System.getenv("MAVEN_CENTRAL_PORTAL_USERNAME")
password System.getenv("MAVEN_CENTRAL_PORTAL_PASSWORD")
}
}
}
}
signing {
def signingKeyId = System.getenv("ORG_GRADLE_PROJECT_signingKeyId")
def signingKey = System.getenv("ORG_GRADLE_PROJECT_signingKey")
def signingPassword = System.getenv("ORG_GRADLE_PROJECT_signingPassword")
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign publishing.publications.mavenJava
}
}
}