From fdafe8b27ee8ad60359290939fdfd99a0ac859f8 Mon Sep 17 00:00:00 2001 From: Ryan Bogan <10944539+ryanbogan@users.noreply.github.com> Date: Mon, 5 Jun 2023 06:56:01 -0700 Subject: [PATCH] Fix publishing to sonatype (#804) * Fix publishing to sonatype Signed-off-by: Ryan Bogan * Disable additional check coming from opensearch plugin Signed-off-by: Ryan Bogan * Added resolution strategy Signed-off-by: Ryan Bogan * Resolution strategies Signed-off-by: Ryan Bogan --------- Signed-off-by: Ryan Bogan --- build.gradle | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/build.gradle b/build.gradle index 4813202d..91eb4458 100644 --- a/build.gradle +++ b/build.gradle @@ -89,6 +89,27 @@ 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" + } + } + } +} + +validateMavenJavaPom.enabled = false + repositories { mavenLocal() mavenCentral() @@ -155,6 +176,9 @@ 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("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}")