From 6f4c8abbe1da46ef3bb3b9f35e42d32724f9609c Mon Sep 17 00:00:00 2001 From: Ryan Bogan Date: Fri, 2 Jun 2023 22:31:48 +0000 Subject: [PATCH 1/5] Fix publishing to sonatype Signed-off-by: Ryan Bogan --- build.gradle | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/build.gradle b/build.gradle index 4813202d..23f0f282 100644 --- a/build.gradle +++ b/build.gradle @@ -89,6 +89,25 @@ allprojects { group 'org.opensearch.sdk' version '2.0.0-SNAPSHOT' +publishing { + publications { + mavenJava(MavenPublication) { + from components.java + } + } + + repositories { + maven { + name = "Snapshots" // optional target repository name + url = "https://aws.oss.sonatype.org/content/repositories/snapshots" + credentials { + username "$System.env.SONATYPE_USERNAME" + password "$System.env.SONATYPE_PASSWORD" + } + } + } +} + repositories { mavenLocal() mavenCentral() From 215870a39a12172d88b7c92fda9bd6de1d2049c3 Mon Sep 17 00:00:00 2001 From: Ryan Bogan Date: Fri, 2 Jun 2023 22:40:31 +0000 Subject: [PATCH 2/5] Disable additional check coming from opensearch plugin Signed-off-by: Ryan Bogan --- build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.gradle b/build.gradle index 23f0f282..2957377d 100644 --- a/build.gradle +++ b/build.gradle @@ -108,6 +108,8 @@ publishing { } } +validateMavenJavaPom.enabled = false + repositories { mavenLocal() mavenCentral() From 373b05ad8589ed6761bf7a188824bb68203e9e8d Mon Sep 17 00:00:00 2001 From: Ryan Bogan Date: Fri, 2 Jun 2023 22:45:43 +0000 Subject: [PATCH 3/5] Added resolution strategy Signed-off-by: Ryan Bogan --- build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/build.gradle b/build.gradle index 2957377d..589f0f34 100644 --- a/build.gradle +++ b/build.gradle @@ -176,6 +176,7 @@ dependencies { resolutionStrategy.force("jakarta.json:jakarta.json-api:${jakartaVersion}") resolutionStrategy.force("com.fasterxml.jackson.core:jackson-databind:${jacksonDatabindVersion}") resolutionStrategy.force("com.fasterxml.jackson.core:jackson-core:${jacksonDatabindVersion}") + resolutionStrategy.force("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${jacksonDatabindVersion}") resolutionStrategy.force("org.apache.logging.log4j:log4j-api:${log4jVersion}") resolutionStrategy.force("org.apache.logging.log4j:log4j-core:${log4jVersion}") resolutionStrategy.force("org.apache.logging.log4j:log4j-jul:${log4jVersion}") From d1fbe006228471e0c95f142f07756d473f938719 Mon Sep 17 00:00:00 2001 From: Ryan Bogan Date: Fri, 2 Jun 2023 22:53:52 +0000 Subject: [PATCH 4/5] Resolution strategies Signed-off-by: Ryan Bogan --- build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.gradle b/build.gradle index 589f0f34..91eb4458 100644 --- a/build.gradle +++ b/build.gradle @@ -177,6 +177,8 @@ dependencies { resolutionStrategy.force("com.fasterxml.jackson.core:jackson-databind:${jacksonDatabindVersion}") resolutionStrategy.force("com.fasterxml.jackson.core:jackson-core:${jacksonDatabindVersion}") resolutionStrategy.force("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${jacksonDatabindVersion}") + resolutionStrategy.force("com.fasterxml.jackson.dataformat:jackson-dataformat-smile:${jacksonDatabindVersion}") + resolutionStrategy.force("com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:${jacksonDatabindVersion}") resolutionStrategy.force("org.apache.logging.log4j:log4j-api:${log4jVersion}") resolutionStrategy.force("org.apache.logging.log4j:log4j-core:${log4jVersion}") resolutionStrategy.force("org.apache.logging.log4j:log4j-jul:${log4jVersion}") From c0feb08ddcb3b8b55c2d99d202374e5460d9ffcc Mon Sep 17 00:00:00 2001 From: Ryan Bogan Date: Mon, 5 Jun 2023 18:21:37 +0000 Subject: [PATCH 5/5] Add dependsOn tasks to fix publishing to maven local Signed-off-by: Ryan Bogan --- build.gradle | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 91eb4458..e495fb38 100644 --- a/build.gradle +++ b/build.gradle @@ -90,6 +90,7 @@ group 'org.opensearch.sdk' version '2.0.0-SNAPSHOT' publishing { + publications { mavenJava(MavenPublication) { from components.java @@ -108,7 +109,8 @@ publishing { } } -validateMavenJavaPom.enabled = false +tasks.named("publishMavenJavaPublicationToMavenLocal").configure { dependsOn("generatePomFileForNebulaPublication") } +tasks.named("publishNebulaPublicationToMavenLocal").configure { dependsOn("generatePomFileForMavenJavaPublication") } repositories { mavenLocal()