opentelemetry-java-instrume.../gradle/publish.gradle

101 lines
2.6 KiB
Groovy

apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.artifactory'
apply plugin: 'com.jfrog.bintray'
publishing {
repositories {
maven {
url = "$rootDir/build/repo"
}
}
publications {
maven(MavenPublication) {
artifact javadocJar
artifact sourcesJar
artifact shadowJar
pom {
name = 'OpenTelemetry Instrumentation for Java'
packaging = 'jar'
url = 'https://github.com/open-telemetry/opentelemetry-java-instrumentation'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'opentelemetry'
name = 'OpenTelemetry Gitter'
url = 'https://gitter.im/open-telemetry/opentelemetry-java-instrumentation'
}
}
scm {
connection = 'scm:git:git@github.com:open-telemetry/opentelemetry-java-instrumentation.git'
developerConnection = 'scm:git:git@github.com:open-telemetry/opentelemetry-java-instrumentation.git'
url = 'git@github.com:open-telemetry/opentelemetry-auto-instr-java.git'
}
afterEvaluate {
// description is not available until evaluated.
description = project.description
}
}
}
}
}
bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_API_KEY')
publications = ['maven']
publish = true
pkg {
repo = 'maven'
name = 'opentelemetry-java-instrumentation'
licenses = ['Apache-2.0']
websiteUrl = 'https://github.com/open-telemetry/opentelemetry-java-instrumentation'
issueTrackerUrl = 'https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues'
vcsUrl = 'https://github.com/open-telemetry/opentelemetry-java-instrumentation.git'
userOrg = 'open-telemetry'
githubRepo = 'open-telemetry/opentelemetry-java-instrumentation'
version {
name = project.version
released = new Date()
gpg {
sign = true
}
mavenCentralSync {
user = System.getenv("SONATYPE_USER")
password = System.getenv("SONATYPE_KEY")
}
}
}
}
bintrayUpload.enabled = !version.toString().contains('SNAPSHOT')
// Snapshot publishing.
artifactory {
contextUrl = 'https://oss.jfrog.org'
publish {
repository {
repoKey = 'oss-snapshot-local'
username = System.getenv("BINTRAY_USER")
password = System.getenv("BINTRAY_API_KEY")
}
}
}
artifactoryPublish {
publications ('maven')
}