Skip to content

Commit

Permalink
Configure maven-publish for uploading to bintray instead of bintray p… (
Browse files Browse the repository at this point in the history
#1789)

* Configure maven-publish for uploading to bintray instead of bintray plugin.

* Snapshots too
  • Loading branch information
Anuraag Agrawal committed Nov 28, 2020
1 parent f9671e7 commit cc07597
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 51 deletions.
2 changes: 0 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import nebula.plugin.release.git.opinion.Strategies
plugins {
id 'idea'

id "com.jfrog.artifactory" version "4.18.1" apply false
id 'com.jfrog.bintray' version '1.8.5' apply false
id "nebula.release" version "15.3.0"

id 'org.gradle.test-retry' version '1.2.0' apply false
Expand Down
58 changes: 9 additions & 49 deletions gradle/publish.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'com.jfrog.artifactory'
apply plugin: 'com.jfrog.bintray'

publishing {
repositories {
maven {
url = "$rootDir/build/repo"
url = version.toString().contains('SNAPSHOT')
? "https://oss.jfrog.org/artifactory/oss-snapshot-local/"
: "https://api.bintray.com/maven/open-telemetry/maven/opentelemetry-java-instrumentation/"
credentials {
username = System.getenv('BINTRAY_USER')
password = System.getenv('BINTRAY_API_KEY')
}
}
}

publications {
maven(MavenPublication) {
if (project.tasks.findByName("shadowJar") != null && !findProperty('noShadowPublish')) {
Expand Down Expand Up @@ -84,52 +89,7 @@ private String artifactPrefix(Project p, String archivesBaseName) {
return 'opentelemetry-'
}

bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_API_KEY')
publications = ['maven']
publish = false
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()

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 {
enabled = version.toString().contains('SNAPSHOT')
publications('maven')
}
rootProject.tasks.release.finalizedBy tasks.publish

tasks.withType(Sign).configureEach {
onlyIf { System.getenv("CI") != null }
Expand Down

0 comments on commit cc07597

Please sign in to comment.