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

Adding gradle publish task to ppl & protocol module to create slim jars #2445

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ spotless {
}
}

project(':opensearch-sql-plugin'){
group = 'org.opensearch'
}

allprojects {
version = opensearch_version.tokenize('-')[0] + '.0'
if (buildVersionQualifier) {
Expand Down
37 changes: 37 additions & 0 deletions ppl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ plugins {
id "io.freefair.lombok"
id 'jacoco'
id 'antlr'
id 'maven-publish'
}

generateGrammarSource {
Expand Down Expand Up @@ -97,3 +98,39 @@ jacocoTestCoverageVerification {
}
}
check.dependsOn jacocoTestCoverageVerification

publishing {
publications {
mavenJava(MavenPublication) {
groupId = 'org.opensearch'
artifactId = 'opensearch-ppl'
from components.java
pom {
name = 'opensearch-ppl'
description = 'OpenSearch PPL'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
name = 'OpenSearch'
url = 'https://github.com/opensearch-project/sql'
}
}
}
}
}
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"
}
}
}
}
37 changes: 37 additions & 0 deletions protocol/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ plugins {
id 'java'
id "io.freefair.lombok"
id 'jacoco'
id 'maven-publish'
}

dependencies {
Expand Down Expand Up @@ -89,3 +90,39 @@ jacocoTestCoverageVerification {
}
check.dependsOn jacocoTestCoverageVerification
jacocoTestCoverageVerification.dependsOn jacocoTestReport

publishing {
publications {
mavenJava(MavenPublication) {
groupId = 'org.opensearch'
artifactId = 'opensearch-protocol'
Comment on lines +97 to +98
Copy link
Collaborator

Choose a reason for hiding this comment

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

The whole SQL plugin artifact is published here: https://mvnrepository.com/artifact/org.opensearch.plugin/opensearch-sql-plugin
So we want to publish its slim jar to a different group and artifact ID?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This won't change the plugin's location in maven repo, this only controls the slim jar's location and it seems opensearch jars are always under org.opensearch folder: https://mvnrepository.com/search?q=org.opensearch&p=1

from components.java
pom {
name = 'opensearch-protocol'
description = 'OpenSearch Protocol'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
name = 'OpenSearch'
url = 'https://github.com/opensearch-project/sql'
}
}
}
}
}
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"
}
}
}
}
Loading