|
1 | 1 | apply plugin: 'maven-publish' |
2 | 2 | apply plugin: 'signing' |
3 | | -apply plugin: 'com.jfrog.artifactory' |
4 | | -apply plugin: 'com.jfrog.bintray' |
5 | 3 |
|
6 | 4 | publishing { |
7 | 5 | repositories { |
8 | 6 | 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 | + } |
10 | 14 | } |
11 | 15 | } |
| 16 | + |
12 | 17 | publications { |
13 | 18 | maven(MavenPublication) { |
14 | 19 | if (project.tasks.findByName("shadowJar") != null && !findProperty('noShadowPublish')) { |
@@ -84,52 +89,7 @@ private String artifactPrefix(Project p, String archivesBaseName) { |
84 | 89 | return 'opentelemetry-' |
85 | 90 | } |
86 | 91 |
|
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 |
133 | 93 |
|
134 | 94 | tasks.withType(Sign).configureEach { |
135 | 95 | onlyIf { System.getenv("CI") != null } |
|
0 commit comments