From f05c27db9037feb2af108674600635e90fa7fc94 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 25 Jul 2023 15:13:27 -0700 Subject: [PATCH] Updated POM publishing (#903) (#905) * Updated POM publishing * Added description, licenses and developer information --------- (cherry picked from commit 2af7ee842938abafdae75142a72da45fb56058ef) Signed-off-by: Owais Kazi Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] --- build.gradle | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/build.gradle b/build.gradle index 68e1f456..9953b4d3 100644 --- a/build.gradle +++ b/build.gradle @@ -90,6 +90,34 @@ allprojects { group 'org.opensearch.sdk' +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 { + // add license information to generated poms + all { + pom { + name = "opensearch-sdk-java" + } + pom.withXml { XmlProvider xml -> + Node node = xml.asNode() + node.appendNode('description', 'OpenSearch Java SDK Client') + + 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/opensearch-sdk-java') + } + } + } + } +} + publishing { publications { mavenJava(MavenPublication) {