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

Initial attempt to fix local publication #187

Closed
Closed
Changes from all commits
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
50 changes: 38 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,40 @@ 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 {
repositories {
maven {
name = 'staging'
url = "${rootProject.buildDir}/local-staging-repo"
}
}
publications {
// add license information to generated poms
all {
pom {
name = 'opensearch-flow-framework'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may need to add groupId = "org.opensearch.plugin" here, should fix your problem

Copy link
Member Author

@owaiskazi19 owaiskazi19 Nov 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's here already though. Do you think I should add on L93 as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though it's build successfully but not published at the right location with the above change.

> Task :publishPluginZipPublicationToMavenLocal
Multiple publications with coordinates 'org.opensearch.plugin:opensearch-flow-framework:3.0.0.0-SNAPSHOT' are published to repository 'mavenLocal'. The publications 'nebula' in root project 'opensearch-flow-framework' and 'pluginZip' in root project 'opensearch-flow-framework' will overwrite each other!

BUILD SUCCESSFUL in 688ms
ls ~/.m2/repository/org/opensearch/opensearch-
opensearch-benchmarks/                                   opensearch-job-scheduler-spi-1.2.0.0-javadoc.jar.sha256  opensearch-ml-client/
opensearch-cli/                                          opensearch-job-scheduler-spi-1.2.0.0-javadoc.jar.sha512  opensearch-ml-common/
opensearch-common/                                       opensearch-job-scheduler-spi-1.2.0.0-sources.jar         opensearch-ml-spi/
opensearch-compress/                                     opensearch-job-scheduler-spi-1.2.0.0-sources.jar.md5     opensearch-nio/
opensearch-core/                                         opensearch-job-scheduler-spi-1.2.0.0-sources.jar.sha1    opensearch-performance-analyzer/
opensearch-dissect/                                      opensearch-job-scheduler-spi-1.2.0.0-sources.jar.sha256  opensearch-plugin-classloader/
opensearch-geo/                                          opensearch-job-scheduler-spi-1.2.0.0-sources.jar.sha512  opensearch-plugin-cli/
opensearch-grok/                                         opensearch-job-scheduler-spi-1.2.0.0.jar                 opensearch-secure-sm/
opensearch-job-scheduler/                                opensearch-job-scheduler-spi-1.2.0.0.jar.md5             opensearch-ssl-config/
opensearch-job-scheduler-sample-extension/               opensearch-job-scheduler-spi-1.2.0.0.jar.sha1            opensearch-telemetry/
opensearch-job-scheduler-spi/                            opensearch-job-scheduler-spi-1.2.0.0.jar.sha256          opensearch-upgrade-cli/
opensearch-job-scheduler-spi-1.2.0.0-javadoc.jar         opensearch-job-scheduler-spi-1.2.0.0.jar.sha512          opensearch-x-content/
opensearch-job-scheduler-spi-1.2.0.0-javadoc.jar.md5     opensearch-launchers/                                    
opensearch-job-scheduler-spi-1.2.0.0-javadoc.jar.sha1    opensearch-ml/  

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though it's build successfully but not published at the right location with the above change.

Oh wait, this is for jar publications right?

Copy link
Member Author

@owaiskazi19 owaiskazi19 Nov 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for ./gradlew publishToMavenLocal

./gradlew publishToMavenLocal

> Configure project :
fatal: ambiguous argument '|| true': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
=======================================
OpenSearch Build Hamster says Hello!
  Gradle Version        : 8.4
  OS Info               : Linux 5.11.0-1020-aws (amd64)
  Runtime JDK Version   : 14 (Private Build JDK)
  Runtime java.home     : /usr/lib/jvm/java-14-openjdk-amd64
  Gradle JDK Version    : 17 (Oracle JDK)
  Gradle java.home      : /usr/lib/jvm/java-17/jdk-17.0.1
  Random Testing Seed   : A23D4553EE612FE1
  In FIPS 140 mode      : false
=======================================

> Task :publishPluginZipPublicationToMavenLocal
Multiple publications with coordinates 'org.opensearch.plugin:opensearch-flow-framework:3.0.0.0-SNAPSHOT' are published to repository 'mavenLocal'. The publications 'nebula' in root project 'opensearch-flow-framework' and 'pluginZip' in root project 'opensearch-flow-framework' will overwrite each other!

BUILD SUCCESSFUL in 781ms
15 actionable tasks: 5 executed, 10 up-to-date

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for ./gradlew publishToMavenLocal

Thanks @owaiskazi19 , back on that, could you please just clarify one question for me: this plugin should only publish the plugin ZIP or also client JARs?

Copy link
Member Author

@owaiskazi19 owaiskazi19 Nov 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed this @reta. Yes, it should publish the plugin ZIP.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@owaiskazi19 np at all, sorry I cannot push the change here, but here we are , #226

description = 'OpenSearch plugin that enables builders to innovate AI apps on OpenSearch'
}
pom.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')
}
}
}
}
}

publishing {
publications {
Expand All @@ -86,18 +120,6 @@ 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"
}
}
}
}
}
Expand All @@ -124,6 +146,10 @@ java {
sourceCompatibility = JavaVersion.VERSION_11
}

tasks.matching {it.path in [":publishNebulaPublicationToMavenLocal"]}.all { task ->
task.dependsOn 'generatePomFileForPluginZipPublication'
}

repositories {
mavenLocal()
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
Expand Down
Loading