From bfc73f79df390faf273cd3cc9a4823d117506e8d Mon Sep 17 00:00:00 2001 From: Andriy Redko Date: Thu, 30 Nov 2023 09:07:03 -0500 Subject: [PATCH 1/3] Use only pluginZip publication of Apache Maven artifacts Signed-off-by: Andriy Redko --- build.gradle | 45 +++++++++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/build.gradle b/build.gradle index 9f8bc9429..2b24c6108 100644 --- a/build.gradle +++ b/build.gradle @@ -35,9 +35,6 @@ dependencyLicenses.enabled = false loggerUsageCheck.enabled = false thirdPartyAudit.enabled = false -// No need to validate pom, as we do not upload to maven/sonatype -validateNebulaPom.enabled = false - buildscript { ext { opensearch_version = System.getProperty("opensearch.version", "3.0.0-SNAPSHOT") @@ -74,6 +71,11 @@ buildscript { } } +allprojects { + // Default to the apache license + project.ext.licenseName = 'The Apache Software License, Version 2.0' + project.ext.licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt' +} publishing { publications { @@ -86,23 +88,28 @@ publishing { name = pluginName description = pluginDescription groupId = "org.opensearch.plugin" - licenses { - license { - name = "The Apache License, Version 2.0" - url = "http://www.apache.org/licenses/LICENSE-2.0.txt" - } - } - developers { - developer { - name = "OpenSearch Flow Framework Plugin" - url = "https://github.com/opensearch-project/flow-framework" - } + + withXml { XmlProvider xml -> + Node node = xml.asNode() + node.appendNode('inceptionYear', '2021') + + Node license = node.appendNode('licenses').appendNode('license') + license.appendNode('name', project.licenseName) + license.appendNode('url', project.licenseUrl) + + Node developer = node.appendNode('developers').appendNode('developer') + developer.appendNode('name', 'OpenSearch') + developer.appendNode('url', 'https://github.com/opensearch-project/flow-framework') } } } } repositories { + maven { + name = 'staging' + url = "${rootProject.buildDir}/local-staging-repo" + } maven { name = "Snapshots" url = "https://aws.oss.sonatype.org/content/repositories/snapshots" @@ -261,3 +268,13 @@ diffCoverageReport { failOnViolation = true } } + + +tasks.withType(AbstractPublishToMaven) { + def predicate = provider { + publication.name == "pluginZip" + } + onlyIf("Publishing only ZIP distributions") { + predicate.get() + } +} From 1f73a06840b4473e7683dd71bbc2a63194fcffb7 Mon Sep 17 00:00:00 2001 From: Andriy Redko Date: Thu, 30 Nov 2023 16:25:21 -0500 Subject: [PATCH 2/3] Address code review comments Signed-off-by: Andriy Redko --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 2b24c6108..d4a944611 100644 --- a/build.gradle +++ b/build.gradle @@ -92,11 +92,11 @@ publishing { withXml { XmlProvider xml -> Node node = xml.asNode() node.appendNode('inceptionYear', '2021') - + Node license = node.appendNode('licenses').appendNode('license') license.appendNode('name', project.licenseName) license.appendNode('url', project.licenseUrl) - + Node developer = node.appendNode('developers').appendNode('developer') developer.appendNode('name', 'OpenSearch') developer.appendNode('url', 'https://github.com/opensearch-project/flow-framework') From ca3bd465c6d264b828d70ef65dae330aec481555 Mon Sep 17 00:00:00 2001 From: Andriy Redko Date: Thu, 30 Nov 2023 16:41:13 -0500 Subject: [PATCH 3/3] Address code review comments Signed-off-by: Andriy Redko --- build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.gradle b/build.gradle index d4a944611..58af38301 100644 --- a/build.gradle +++ b/build.gradle @@ -35,6 +35,9 @@ dependencyLicenses.enabled = false loggerUsageCheck.enabled = false thirdPartyAudit.enabled = false +// No need to validate pom, as we do not upload to maven/sonatype +validateNebulaPom.enabled = false + buildscript { ext { opensearch_version = System.getProperty("opensearch.version", "3.0.0-SNAPSHOT")