Skip to content

Commit cc07597

Browse files
author
Anuraag Agrawal
authored
Configure maven-publish for uploading to bintray instead of bintray p… (#1789)
* Configure maven-publish for uploading to bintray instead of bintray plugin. * Snapshots too
1 parent f9671e7 commit cc07597

File tree

2 files changed

+9
-51
lines changed

2 files changed

+9
-51
lines changed

build.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import nebula.plugin.release.git.opinion.Strategies
33
plugins {
44
id 'idea'
55

6-
id "com.jfrog.artifactory" version "4.18.1" apply false
7-
id 'com.jfrog.bintray' version '1.8.5' apply false
86
id "nebula.release" version "15.3.0"
97

108
id 'org.gradle.test-retry' version '1.2.0' apply false

gradle/publish.gradle

Lines changed: 9 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
apply plugin: 'maven-publish'
22
apply plugin: 'signing'
3-
apply plugin: 'com.jfrog.artifactory'
4-
apply plugin: 'com.jfrog.bintray'
53

64
publishing {
75
repositories {
86
maven {
9-
url = "$rootDir/build/repo"
7+
url = version.toString().contains('SNAPSHOT')
8+
? "https://oss.jfrog.org/artifactory/oss-snapshot-local/"
9+
: "https://api.bintray.com/maven/open-telemetry/maven/opentelemetry-java-instrumentation/"
10+
credentials {
11+
username = System.getenv('BINTRAY_USER')
12+
password = System.getenv('BINTRAY_API_KEY')
13+
}
1014
}
1115
}
16+
1217
publications {
1318
maven(MavenPublication) {
1419
if (project.tasks.findByName("shadowJar") != null && !findProperty('noShadowPublish')) {
@@ -84,52 +89,7 @@ private String artifactPrefix(Project p, String archivesBaseName) {
8489
return 'opentelemetry-'
8590
}
8691

87-
bintray {
88-
user = System.getenv('BINTRAY_USER')
89-
key = System.getenv('BINTRAY_API_KEY')
90-
publications = ['maven']
91-
publish = false
92-
pkg {
93-
repo = 'maven'
94-
name = 'opentelemetry-java-instrumentation'
95-
licenses = ['Apache-2.0']
96-
websiteUrl = 'https://github.com/open-telemetry/opentelemetry-java-instrumentation'
97-
issueTrackerUrl = 'https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues'
98-
vcsUrl = 'https://github.com/open-telemetry/opentelemetry-java-instrumentation.git'
99-
userOrg = 'open-telemetry'
100-
101-
githubRepo = 'open-telemetry/opentelemetry-java-instrumentation'
102-
103-
version {
104-
name = project.version
105-
released = new Date()
106-
107-
mavenCentralSync {
108-
user = System.getenv("SONATYPE_USER")
109-
password = System.getenv("SONATYPE_KEY")
110-
}
111-
}
112-
}
113-
}
114-
115-
bintrayUpload.enabled = !version.toString().contains('SNAPSHOT')
116-
117-
// Snapshot publishing.
118-
artifactory {
119-
contextUrl = 'https://oss.jfrog.org'
120-
publish {
121-
repository {
122-
repoKey = 'oss-snapshot-local'
123-
username = System.getenv("BINTRAY_USER")
124-
password = System.getenv("BINTRAY_API_KEY")
125-
}
126-
}
127-
}
128-
129-
artifactoryPublish {
130-
enabled = version.toString().contains('SNAPSHOT')
131-
publications('maven')
132-
}
92+
rootProject.tasks.release.finalizedBy tasks.publish
13393

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

0 commit comments

Comments
 (0)