Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Adds maven publish task to notification (#97) (#167)
Browse files Browse the repository at this point in the history
* Adds maven publish task to notification
  • Loading branch information
dbbaughe authored Feb 20, 2020
1 parent 47bd64d commit 113355c
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions notification/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
* permissions and limitations under the License.
*/

apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'maven-publish'
apply plugin: 'signing'

dependencies {
compileOnly "org.elasticsearch:elasticsearch:${es_version}"
Expand All @@ -24,3 +27,78 @@ dependencies {
testImplementation "org.elasticsearch.test:framework:${es_version}"
testImplementation "org.easymock:easymock:4.0.1"
}

shadowJar {
relocate 'org.apache.http', 'com.amazon.opendistroforelasticsearch.notification.repackage.org.apache.http'
relocate 'org.apache.commons.logging', 'com.amazon.opendistroforelasticsearch.notification.repackage.org.apache.commons.logging'
relocate 'org.apache.commons.codec', 'com.amazon.opendistroforelasticsearch.notification.repackage.org.apache.commons.codec'
classifier = null
}

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

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

publishing {
publications {
shadow(MavenPublication) {
project.shadow.component(it)
groupId = 'com.amazon.opendistroforelasticsearch'
artifactId = 'notification'

artifact sourcesJar
artifact javadocJar

pom {
name = "Open Distro for Elasticsearch Notification"
packaging = "jar"
url = "https://github.com/opendistro-for-elasticsearch/alerting"
description = "Open Distro for Elasticsearch Notification"
scm {
connection = "scm:[email protected]:opendistro-for-elasticsearch/alerting.git"
developerConnection = "scm:[email protected]:opendistro-for-elasticsearch/alerting.git"
url = "[email protected]:opendistro-for-elasticsearch/alerting.git"
}
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
id = "amazonwebservices"
organization = "Amazon Web Services"
organizationUrl = "https://aws.amazon.com"
}
}
}
}
}

repositories {
maven {
name = "sonatype-staging"
url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
credentials {
username project.hasProperty('ossrhUsername') ? project.property('ossrhUsername') : ''
password project.hasProperty('ossrhPassword') ? project.property('ossrhPassword') : ''
}
}
}

// TODO - enabled debug logging for the time being, remove this eventually
gradle.startParameter.setShowStacktrace(ShowStacktrace.ALWAYS)
gradle.startParameter.setLogLevel(LogLevel.DEBUG)

signing {
required { gradle.taskGraph.hasTask("publishShadowPublicationToSonatype-stagingRepository") }
sign publishing.publications.shadow
}
}

0 comments on commit 113355c

Please sign in to comment.