Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use only pluginZip publication of Apache Maven artifacts #226

Merged
merged 3 commits into from
Nov 30, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 31 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
owaiskazi19 marked this conversation as resolved.
Show resolved Hide resolved

buildscript {
ext {
opensearch_version = System.getProperty("opensearch.version", "3.0.0-SNAPSHOT")
Expand Down Expand Up @@ -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 {
Expand All @@ -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"
owaiskazi19 marked this conversation as resolved.
Show resolved Hide resolved
}
maven {
name = "Snapshots"
url = "https://aws.oss.sonatype.org/content/repositories/snapshots"
Expand Down Expand Up @@ -261,3 +268,13 @@ diffCoverageReport {
failOnViolation = true
}
}


tasks.withType(AbstractPublishToMaven) {
owaiskazi19 marked this conversation as resolved.
Show resolved Hide resolved
def predicate = provider {
publication.name == "pluginZip"
}
onlyIf("Publishing only ZIP distributions") {
predicate.get()
}
}
Loading