Skip to content

Commit d1f0434

Browse files
authored
ci: updating nexus publish plugin version (#26)
Updating nexus plugin
1 parent e587ee5 commit d1f0434

File tree

13 files changed

+25
-56
lines changed

13 files changed

+25
-56
lines changed

.github/workflows/java-server-sdk.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656

5757
- name: Publish Maven Local
5858
shell: bash
59-
run: lib/sdk/server/gradlew publishToMavenLocal -p lib/sdk/server -P LD_SKIP_SIGNING=1
59+
run: lib/sdk/server/gradlew publishToMavenLocal -p lib/sdk/server -P skipSigning=true
6060

6161
- name: Run Packaging Test
6262
shell: bash

lib/java-server-sdk-otel/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ publishing {
7777
nexusPublishing {
7878
clientTimeout = java.time.Duration.ofMinutes(2) // we've seen extremely long delays in creating repositories
7979
repositories {
80-
sonatype ()
80+
sonatype()
8181
}
8282
}
8383

lib/sdk/server/build.gradle

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ plugins {
2121
id "signing"
2222
id "com.github.johnrengelman.shadow" version "7.1.2"
2323
id "maven-publish"
24-
id "de.marcphilipp.nexus-publish" version "0.3.0"
24+
id "io.github.gradle-nexus.publish-plugin" version "1.3.0" apply false
2525
id "io.codearte.nexus-staging" version "0.21.2"
2626
id "org.ajoberstar.git-publish" version "2.1.3"
2727
id "idea"
@@ -599,26 +599,24 @@ publishing {
599599
}
600600
}
601601

602-
nexusPublishing {
603-
clientTimeout = java.time.Duration.ofMinutes(2) // we've seen extremely long delays in creating repositories
604-
repositories {
605-
sonatype {}
602+
// The current version of the nexus publish plugin is not well designed and so must be only be applied when this is the root project.
603+
// This was added to allow other projects to use this server sdk as a subproject (e.g. the contract test service)
604+
if (project == rootProject) {
605+
apply plugin: "io.github.gradle-nexus.publish-plugin"
606+
607+
nexusPublishing {
608+
clientTimeout = java.time.Duration.ofMinutes(2) // we've seen extremely long delays in creating repositories
609+
repositories {
610+
sonatype()
611+
}
606612
}
607613
}
608614

609615
signing {
616+
required { findProperty("skipSigning") != "true" }
610617
sign publishing.publications.shadow
611618
}
612619

613-
tasks.withType(Sign) { t ->
614-
onlyIf { !shouldSkipSigning() } // so we can build jars for testing in CI
615-
}
616-
617-
def shouldSkipSigning() {
618-
return "1".equals(project.findProperty("LD_SKIP_SIGNING")) ||
619-
"1".equals(System.getenv("LD_SKIP_SIGNING"))
620-
}
621-
622620
// This task is used by the logic in ./packaging-test to get copies of all the direct and transitive
623621
// dependencies of the SDK, so they can be put on the classpath as needed during tests.
624622
task exportDependencies(type: Copy, dependsOn: compileJava) {

lib/sdk/server/gradle.properties

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,5 @@
22
version=7.5.0
33
#x-release-please-end
44

5-
# The following empty ossrh properties are used by LaunchDarkly's internal integration testing framework
6-
# and should not be needed for typical development purposes (including by third-party developers).
7-
ossrhUsername=
8-
ossrhPassword=
9-
105
# See https://github.com/gradle/gradle/issues/11308 regarding the following property
116
systemProp.org.gradle.internal.publish.checksums.insecure=true

lib/sdk/server/gradle.properties.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ githubPassword = YOUR_GITHUB_PASSWORD
44
signing.keyId = 5669D902
55
signing.password = SIGNING_PASSWORD
66
signing.secretKeyRingFile = SECRET_RING_FILE
7-
ossrhUsername = launchdarkly
8-
ossrhPassword = OSSHR_PASSWORD
7+
sonatypeUsername = launchdarkly
8+
sonatypePassword = OSSHR_PASSWORD

lib/sdk/server/packaging-test/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ test-pom: $(POM_XML)
115115
@! grep '<dependency>' $< || (echo " FAILED" && exit 1)
116116

117117
$(SDK_DEFAULT_JAR) $(SDK_ALL_JAR) $(SDK_THIN_JAR) $(POM_XML):
118-
cd .. && ./gradlew publishToMavenLocal -P version=$(LOCAL_VERSION) -P LD_SKIP_SIGNING=1
118+
cd .. && ./gradlew publishToMavenLocal -P version=$(LOCAL_VERSION) -P skipSigning=true
119119
@# publishToMavenLocal creates not only the jars but also the pom
120120

121121
$(TEST_APP_JAR): $(SDK_THIN_JAR) $(TEST_APP_SOURCES) | $(TEMP_DIR)

lib/shared/common/build.gradle.kts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import java.time.Duration
22

3-
// These values come from gradle.properties
4-
val ossrhUsername: String by project
5-
val ossrhPassword: String by project
6-
73
buildscript {
84
repositories {
95
mavenCentral()
@@ -92,10 +88,7 @@ nexusStaging {
9288
nexusPublishing {
9389
clientTimeout.set(Duration.ofMinutes(2)) // we've seen extremely long delays in creating repositories
9490
repositories {
95-
sonatype {
96-
username.set(ossrhUsername)
97-
password.set(ossrhPassword)
98-
}
91+
sonatype()
9992
}
10093
}
10194

lib/shared/common/buildSrc/src/main/kotlin/Dependencies.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ object Versions {
99
}
1010

1111
object PluginVersions {
12-
const val nexusPublish = "0.3.0"
12+
const val nexusPublish = "1.3.0"
1313
const val nexusStaging = "0.30.0"
1414
}
1515

@@ -61,7 +61,7 @@ object Libs {
6161
)
6262

6363
val javaExtGradlePlugins = mapOf(
64-
"de.marcphilipp.nexus-publish" to PluginVersions.nexusPublish,
64+
"io.github.gradle-nexus.publish-plugin" to PluginVersions.nexusPublish,
6565
"io.codearte.nexus-staging" to PluginVersions.nexusStaging
6666
)
6767
}

lib/shared/common/gradle.properties

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
#x-release-please-start-version
22
version=2.1.1
33
#x-release-please-end
4-
5-
# The following empty ossrh properties are used by LaunchDarkly's internal integration testing framework
6-
# and should not be needed for typical development purposes (including by third-party developers).
7-
ossrhUsername=
8-
ossrhPassword=

lib/shared/internal/build.gradle.kts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import java.time.Duration
22

3-
// These values come from gradle.properties
4-
val ossrhUsername: String by project
5-
val ossrhPassword: String by project
6-
73
buildscript {
84
repositories {
95
mavenCentral()
@@ -86,10 +82,7 @@ nexusStaging {
8682
nexusPublishing {
8783
clientTimeout.set(Duration.ofMinutes(2)) // we've seen extremely long delays in creating repositories
8884
repositories {
89-
sonatype {
90-
username.set(ossrhUsername)
91-
password.set(ossrhPassword)
92-
}
85+
sonatype()
9386
}
9487
}
9588

0 commit comments

Comments
 (0)