1
- apply plugin : ' java'
2
- apply plugin : ' maven-publish'
3
- apply plugin : ' signing'
4
- apply plugin : ' idea'
5
- apply plugin : ' com.github.johnrengelman.shadow'
6
- apply plugin : ' io.codearte.nexus-staging'
7
- apply plugin : ' org.ajoberstar.github-pages'
1
+
2
+ buildscript {
3
+ repositories {
4
+ mavenCentral()
5
+ mavenLocal()
6
+ }
7
+ }
8
+
9
+ plugins {
10
+ id " java"
11
+ id " java-library"
12
+ id " checkstyle"
13
+ id " signing"
14
+ id " com.github.johnrengelman.shadow" version " 4.0.4"
15
+ id " maven-publish"
16
+ id " de.marcphilipp.nexus-publish" version " 0.3.0"
17
+ id " io.codearte.nexus-staging" version " 0.21.2"
18
+ id " org.ajoberstar.git-publish" version " 2.1.3"
19
+ id " idea"
20
+ }
8
21
9
22
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
10
23
@@ -68,19 +81,6 @@ dependencies {
68
81
shadow libraries. external
69
82
}
70
83
71
- buildscript {
72
- repositories {
73
- jcenter()
74
- mavenCentral()
75
- mavenLocal()
76
- }
77
- dependencies {
78
- classpath ' org.ajoberstar:gradle-git:1.5.0-rc.1'
79
- classpath ' com.github.jengelman.gradle.plugins:shadow:2.0.4'
80
- classpath " io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.8.0"
81
- }
82
- }
83
-
84
84
task sourcesJar (type : Jar , dependsOn : classes) {
85
85
classifier = ' sources'
86
86
from sourceSets. main. allSource
@@ -130,6 +130,7 @@ idea {
130
130
131
131
nexusStaging {
132
132
packageGroup = " com.launchdarkly"
133
+ numberOfRetries = 40 // we've seen extremely long delays in closing repositories
133
134
}
134
135
135
136
def pomConfig = {
@@ -170,21 +171,35 @@ publishing {
170
171
171
172
pom. withXml {
172
173
def root = asNode()
173
- root. appendNode(' description' , ' DynamoDB-backed feature store for the LaunchDarkly Java SDK' )
174
- asNode(). children(). last() + pomConfig
174
+ root. appendNode(' description' , ' DynamoDB-backed data store for the LaunchDarkly Java SDK' )
175
+
176
+ // The following workaround is for a known issue where the Shadow plugin assumes that all
177
+ // non-shaded dependencies should have "runtime" scope rather than "compile".
178
+ // https://github.com/johnrengelman/shadow/issues/321
179
+ // Currently there doesn't seem to be any way way around this other than simply hacking the
180
+ // pom at this point after it has been generated by Shadow. All of the dependencies that
181
+ // are in the pom at this point should have compile scope.
182
+ def dependenciesNode = root. getAt(' dependencies' ). get(0 )
183
+ dependenciesNode. each { dependencyNode ->
184
+ def scopeNode = dependencyNode. getAt(' scope' ). get(0 )
185
+ scopeNode. setValue(' compile' )
186
+ }
187
+
188
+ root. children(). last() + pomConfig
175
189
}
176
190
}
177
191
}
178
192
repositories {
179
193
mavenLocal()
180
- maven {
181
- def releasesRepoUrl = " https://oss.sonatype.org/service/local/staging/deploy/maven2/"
182
- def snapshotsRepoUrl = " https://oss.sonatype.org/content/repositories/snapshots/"
183
- url = version. endsWith(' SNAPSHOT' ) ? snapshotsRepoUrl : releasesRepoUrl
184
- credentials {
185
- username ossrhUsername
186
- password ossrhPassword
187
- }
194
+ }
195
+ }
196
+
197
+ nexusPublishing {
198
+ clientTimeout = java.time.Duration . ofMinutes(3 ) // we've seen extremely long delays in creating repositories
199
+ repositories {
200
+ sonatype {
201
+ username = ossrhUsername
202
+ password = ossrhPassword
188
203
}
189
204
}
190
205
}
@@ -193,13 +208,11 @@ signing {
193
208
sign publishing. publications. shadow
194
209
}
195
210
196
- githubPages {
197
- repoUri = ' https://github.com/launchdarkly/java-server-sdk-dynamodb.git'
198
- pages {
211
+ gitPublish {
212
+ repoUri
= ' [email protected] :launchdarkly/java-server-sdk-dynamodb.git'
213
+ branch = ' gh-pages'
214
+ contents {
199
215
from javadoc
200
216
}
201
- credentials {
202
- username = githubUser
203
- password = githubPassword
204
- }
217
+ commitMessage = ' publishing javadocs'
205
218
}
0 commit comments