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

enable publishing of alerting-spi jar #1562

Merged
merged 3 commits into from
Jun 3, 2024
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ jobs:
export SONATYPE_PASSWORD=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-password --query SecretString --output text)
echo "::add-mask::$SONATYPE_USERNAME"
echo "::add-mask::$SONATYPE_PASSWORD"
./gradlew publishShadowPublicationToSnapshotsRepository
./gradlew publishPluginZipPublicationToSnapshotsRepository
77 changes: 76 additions & 1 deletion spi/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,89 @@
* SPDX-License-Identifier: Apache-2.0
*/

plugins {
id 'java-library'
id 'maven-publish'
}

apply plugin: 'maven-publish'
apply plugin: 'java'
apply plugin: 'opensearch.java-rest-test'
apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'jacoco'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'opensearch.repositories'

dependencies {
compileOnly "org.opensearch:opensearch:${opensearch_version}"
compileOnly "org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}"
compileOnly "org.opensearch:common-utils:${common_utils_version}@jar"
}
}

shadowJar {
archiveClassifier = null
}

task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allJava
}

task javadocJar(type: Jar) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}

publishing {
repositories {
maven {
name = 'staging'
url = "${rootProject.buildDir}/local-staging-repo"
}
maven {
name = "Snapshots"
url = "https://aws.oss.sonatype.org/content/repositories/snapshots"
credentials {
username "$System.env.SONATYPE_USERNAME"
password "$System.env.SONATYPE_PASSWORD"
}
}
}
publications {
shadow(MavenPublication) {
project.shadow.component(it)
groupId = 'org.opensearch.alerting'
artifactId = 'alerting-spi'

artifact sourcesJar
artifact javadocJar

pom {
name = "OpenSearch Alerting spi"
packaging = "jar"
url = "https://github.com/opensearch-project/alerting"
description = "OpenSearch Alerting spi"
scm {
connection = "scm:[email protected]:opensearch-project/alerting.git"
developerConnection = "scm:[email protected]:opensearch-project/alerting.git"
url = "[email protected]:opensearch-project/alerting.git"
}
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/alerting"
}
}
}
}
}

gradle.startParameter.setShowStacktrace(ShowStacktrace.ALWAYS)
Comment on lines +89 to +90
Copy link
Member

Choose a reason for hiding this comment

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

Will this cause the logs to always be at debug level?

Copy link
Collaborator Author

@sbcd90 sbcd90 Jun 3, 2024

Choose a reason for hiding this comment

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

this will just set the log level for gradle tasks. so no impact on log statements in the code.

gradle.startParameter.setLogLevel(LogLevel.DEBUG)
}
Loading