forked from JetBrains/xodus-dnq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublishing.gradle
116 lines (107 loc) · 4.13 KB
/
publishing.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
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
114
115
116
import java.time.Duration
if (project.hasProperty('ossrhUser') && project.hasProperty('ossrhPassword')) {
// https://github.com/Codearte/gradle-nexus-staging-plugin to close and promote from Nexus staging to maven central
nexusStaging {
username = ossrhUser
password = ossrhPassword
delayBetweenRetriesInMillis = 30000
stagingProfileId = '89ee7caa6631c4'
}
subprojects {
apply plugin: 'signing'
apply plugin: 'de.marcphilipp.nexus-publish'
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact(sourceJar) {
classifier = 'sources'
}
artifact(javadocJar) {
classifier = 'javadoc'
}
pom {
name = project.name
description = 'Data definition and queries Kotlin DSL over Xodus'
url = 'https://github.com/JetBrains/xodus-dnq'
licenses {
license {
name = 'Apache 2.0'
url = 'https://www.apache.org/licenses/'
distribution = 'repo'
}
}
developers {
developer {
id = 'JetBrains'
name = 'JetBrains Team'
organization = 'JetBrains s.r.o'
organizationUrl = 'https://www.jetbrains.com'
}
}
scm {
connection = 'scm:git:https://github.com/JetBrains/xodus-dnq.git'
developerConnection = 'scm:git@github.com:JetBrains/xodus-dnq.git'
url = 'https://github.com/JetBrains/xodus-dnq'
}
}
}
}
repositories {
maven {
url 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
credentials {
username ossrhUser
password ossrhPassword
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
/**
* https://github.com/marcphilipp/nexus-publish-plugin to avoid https://github.com/Codearte/gradle-nexus-staging-plugin/issues/77
* which is relevant for TeamCity as well. publishMavenJavaPublicationToNexusRepository task is recommended, since
* publishToNexus produces duplicates in Nexus staging.
*/
nexusPublishing {
repositories {
sonatype {
packageGroup = rootProject.nexusStaging.packageGroup
username = rootProject.nexusStaging.username
password = rootProject.nexusStaging.password
clientTimeout = Duration.ofMinutes(5)
connectTimeout = Duration.ofMinutes(5)
}
}
}
}
}
// publish snapshot versions to any repo you'd like to see them in
if (project.hasProperty("publishTo")) {
subprojects {
apply plugin: 'maven-publish'
publishing {
repositories {
maven {
url project.publishTo
if (project.hasProperty("publishUsername")) {
credentials {
username = project.publishUsername
password = project.publishPassword
}
}
}
}
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourceJar {
classifier 'sources'
}
}
}
}
}
}