1- apply plugin : ' java'
2- apply plugin : ' checkstyle'
3- apply plugin : ' maven-publish'
4- apply plugin : ' org.ajoberstar.github-pages'
5- apply plugin : ' signing'
6- apply plugin : ' idea'
7- apply plugin : ' com.github.johnrengelman.shadow'
8- apply plugin : ' io.codearte.nexus-staging'
91
10- configurations. all {
11- // check for updates every build for dependencies with: 'changing: true'
12- resolutionStrategy. cacheChangingModulesFor 0 , ' seconds'
2+ buildscript {
3+ repositories {
4+ mavenCentral()
5+ mavenLocal()
6+ }
7+ dependencies {
8+ classpath " org.eclipse.virgo.util:org.eclipse.virgo.util.osgi.manifest:3.5.0.RELEASE"
9+ classpath " org.osgi:osgi_R4_core:1.0"
10+ }
11+ }
12+
13+ plugins {
14+ id " java"
15+ id " java-library"
16+ id " checkstyle"
17+ id " signing"
18+ id " com.github.johnrengelman.shadow" version " 4.0.4"
19+ id " maven-publish"
20+ id " de.marcphilipp.nexus-publish" version " 0.3.0"
21+ id " io.codearte.nexus-staging" version " 0.21.2"
22+ id " org.ajoberstar.git-publish" version " 2.1.3"
23+ id " idea"
1324}
1425
1526repositories {
@@ -19,6 +30,11 @@ repositories {
1930 mavenCentral()
2031}
2132
33+ configurations. all {
34+ // check for updates every build for dependencies with: 'changing: true'
35+ resolutionStrategy. cacheChangingModulesFor 0 , ' seconds'
36+ }
37+
2238allprojects {
2339 group = ' com.launchdarkly'
2440 version = " ${ version} "
@@ -44,7 +60,7 @@ libraries.internal = [
4460 " commons-codec:commons-codec:1.10" ,
4561 " com.google.guava:guava:19.0" ,
4662 " joda-time:joda-time:2.9.3" ,
47- " com.launchdarkly:okhttp-eventsource:1.10.0 " ,
63+ " com.launchdarkly:okhttp-eventsource:1.10.2 " ,
4864 " org.yaml:snakeyaml:1.19" ,
4965 " redis.clients:jedis:2.9.0"
5066]
@@ -58,7 +74,8 @@ libraries.external = [
5874
5975// Add dependencies to "libraries.test" that are used only in unit tests.
6076libraries. test = [
61- " com.squareup.okhttp3:mockwebserver:3.10.0" ,
77+ " com.squareup.okhttp3:mockwebserver:3.12.10" ,
78+ " com.squareup.okhttp3:okhttp-tls:3.12.10" ,
6279 " org.hamcrest:hamcrest-all:1.3" ,
6380 " org.easymock:easymock:3.4" ,
6481 " junit:junit:4.12" ,
@@ -80,21 +97,6 @@ task wrapper(type: Wrapper) {
8097 gradleVersion = ' 4.10.2'
8198}
8299
83- buildscript {
84- repositories {
85- jcenter()
86- mavenCentral()
87- mavenLocal()
88- }
89- dependencies {
90- classpath ' org.ajoberstar:gradle-git:1.5.0-rc.1'
91- classpath ' com.github.jengelman.gradle.plugins:shadow:4.0.4'
92- classpath " io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.8.0"
93- classpath " org.eclipse.virgo.util:org.eclipse.virgo.util.osgi.manifest:3.5.0.RELEASE"
94- classpath " org.osgi:osgi_R4_core:1.0"
95- }
96- }
97-
98100checkstyle {
99101 configFile file(" ${ project.rootDir} /checkstyle.xml" )
100102}
@@ -188,17 +190,6 @@ if (JavaVersion.current().isJava8Compatible()) {
188190 }
189191}
190192
191- githubPages {
192- repoUri = ' https://github.com/launchdarkly/java-server-sdk.git'
193- pages {
194- from javadoc
195- }
196- credentials {
197- username = githubUser
198- password = githubPassword
199- }
200- }
201-
202193// Returns the names of all Java packages defined in this library - not including
203194// enclosing packages like "com" that don't have any classes in them.
204195def getAllSdkPackages () {
@@ -341,6 +332,7 @@ idea {
341332
342333nexusStaging {
343334 packageGroup = " com.launchdarkly"
335+ numberOfRetries = 40 // we've seen extremely long delays in closing repositories
344336}
345337
346338def pomConfig = {
@@ -405,14 +397,15 @@ publishing {
405397 }
406398 repositories {
407399 mavenLocal()
408- maven {
409- def releasesRepoUrl = " https://oss.sonatype.org/service/local/staging/deploy/maven2/"
410- def snapshotsRepoUrl = " https://oss.sonatype.org/content/repositories/snapshots/"
411- url = version. endsWith(' SNAPSHOT' ) ? snapshotsRepoUrl : releasesRepoUrl
412- credentials {
413- username ossrhUsername
414- password ossrhPassword
415- }
400+ }
401+ }
402+
403+ nexusPublishing {
404+ clientTimeout = java.time.Duration . ofMinutes(2 ) // we've seen extremely long delays in creating repositories
405+ repositories {
406+ sonatype {
407+ username = ossrhUsername
408+ password = ossrhPassword
416409 }
417410 }
418411}
@@ -431,3 +424,12 @@ task exportDependencies(type: Copy, dependsOn: compileJava) {
431424 into " packaging-test/temp/dependencies-all"
432425 from configurations. runtime. resolvedConfiguration. resolvedArtifacts. collect { it. file }
433426}
427+
428+ gitPublish {
429+ repoUri
= ' [email protected] :launchdarkly/java-server-sdk.git' 430+ branch = ' gh-pages'
431+ contents {
432+ from javadoc
433+ }
434+ commitMessage = ' publishing javadocs'
435+ }
0 commit comments