Skip to content

Commit 4b8717e

Browse files
authored
ci: updating gradle publishing (#3)
Adds gradle configuration for publishing and signing.
1 parent 5e7a6d3 commit 4b8717e

File tree

3 files changed

+60
-1
lines changed

3 files changed

+60
-1
lines changed

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

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
plugins {
1010
// Apply the java-library plugin for API and implementation separation.
1111
id 'java-library'
12+
id "maven-publish"
13+
id "signing"
14+
id "io.github.gradle-nexus.publish-plugin" version "1.3.0"
1215
}
1316

1417
repositories {
@@ -19,6 +22,14 @@ repositories {
1922
}
2023
}
2124

25+
allprojects {
26+
group = 'com.launchdarkly'
27+
version = "${version}"
28+
archivesBaseName = 'launchdarkly-java-server-sdk-otel'
29+
sourceCompatibility = 1.8
30+
targetCompatibility = 1.8
31+
}
32+
2233
dependencies {
2334
// Use JUnit test framework.
2435
testImplementation 'junit:junit:4.13.2'
@@ -28,3 +39,47 @@ dependencies {
2839
implementation "com.launchdarkly:launchdarkly-java-server-sdk:7.4.0-SNAPSHOT"
2940
implementation "io.opentelemetry:opentelemetry-api:1.2.0"
3041
}
42+
43+
publishing {
44+
publications {
45+
mavenJava(MavenPublication) {
46+
from(components["java"])
47+
48+
pom {
49+
name.set("LaunchDarkly Java Server Otel Integration")
50+
url.set("https://github.com/launchdarkly/java-core")
51+
licenses {
52+
license {
53+
name.set("The Apache License, Version 2.0")
54+
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
55+
}
56+
}
57+
developers {
58+
developer {
59+
name.set("LaunchDarkly SDK Team")
60+
email.set("[email protected]")
61+
}
62+
}
63+
scm {
64+
connection.set("scm:git:git://github.com/launchdarkly/java-core.git")
65+
developerConnection.set("scm:git:ssh:[email protected]:launchdarkly/java-core.git")
66+
url.set("https://github.com/launchdarkly/java-core")
67+
}
68+
}
69+
}
70+
}
71+
}
72+
73+
nexusPublishing {
74+
clientTimeout = java.time.Duration.ofMinutes(2) // we've seen extremely long delays in creating repositories
75+
repositories {
76+
sonatype {
77+
username = ossrhUsername
78+
password = ossrhPassword
79+
}
80+
}
81+
}
82+
83+
signing {
84+
sign(publishing.publications["mavenJava"])
85+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
version=0.1.0
2+
# The following empty ossrh properties are used by LaunchDarkly's internal integration testing framework
3+
# and should not be needed for typical development purposes (including by third-party developers).
4+
ossrhUsername=
5+
ossrhPassword=

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
* in the user manual at https://docs.gradle.org/8.0.2/userguide/multi_project_builds.html
88
*/
99

10-
rootProject.name = 'java-server-sdk-otel'
10+
rootProject.name = 'launchdarkly-java-server-sdk-otel'
1111
include('lib')

0 commit comments

Comments
 (0)