Add bintray publishing
to bypass permission problem in promoting from oss artifactory.
MODIFY
dd-trace-java.gradle
dd-trace-java.gradle
@@ -5,6 +5,7 @@ buildscript {
dependencies {
classpath "io.franzbecker:gradle-lombok:1.8"
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.4.18"
+ classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
}
}
@@ -26,6 +27,33 @@ description = 'dd-trace-java'
// Applied here to allow publishing of artifactory build info
apply from: "${rootDir}/gradle/publish.gradle"
+// Source: https://github.com/ratpack/ratpack/blob/master/ratpack.gradle#L101
+task bintrayPublish() {
+ doLast {
+ if (!project.hasProperty("bintrayApiKey")) {
+ throw new InvalidUserDataException("You must provide bintrayApiKey")
+ }
+
+ if (!project.hasProperty('buildNumber')) {
+ throw new GradleException("Must provide buildNumber of a release from https://oss.jfrog.org/artifactory/webapp/#/builds/dd-trace-java")
+ }
+
+ def curl = ['curl',
+ '-X', 'POST',
+ "-u", "${bintrayUser}:${bintrayApiKey}",
+ "-H", "Content-Type: application/json",
+ "-d", """{
+ "dryRun": "true",
+ "targetRepo": "datadog-maven",
+ "sourceRepos": ["oss-release-local"]
+}
+""",
+ "https://oss.jfrog.org/api/build/distribute/dd-trace-java/$project.buildNumber"
+ ].execute()
+ logger.info("Received response: ${curl.text}")
+ }
+}
+
task wrapper(type: Wrapper) {
gradleVersion = '4.0'
}

MODIFY
gradle/pom.gradle
gradle/pom.gradle
@@ -40,13 +40,13 @@ modifyPom {
name project.name
description project.description
url "https://github.com/datadog/dd-trace-java"
-// licenses {
-// license {
-// name "The Apache Software License, Version 2.0"
-// url "http://www.apache.org/licenses/LICENSE-2.0.txt"
-// distribution "repo"
-// }
-// }
+ licenses {
+ license {
+ name "The Apache Software License, Version 2.0"
+ url "http://www.apache.org/licenses/LICENSE-2.0.txt"
+ distribution "repo"
+ }
+ }
scm {
connection "scm:https://datadog@github.com/datadog/dd-trace-java"
developerConnection "scm:git@github.com:datadog/dd-trace-java.git"

MODIFY
gradle/publish.gradle
gradle/publish.gradle
apply plugin: "maven"
apply plugin: "com.jfrog.artifactory"
+apply plugin: 'com.jfrog.bintray'
apply plugin: "signing"
afterEvaluate {
@@ -30,7 +31,8 @@ tasks.withType(Upload).matching { it.name != "install" }.all {
}
}
-if (project.rootProject != project) {
+def isRoot = project.rootProject == project
+if (!isRoot) {
apply from: "$rootDir/gradle/version.gradle"
apply from: "${rootDir}/gradle/pom.gradle"
@@ -88,8 +90,56 @@ artifactoryPublish { task ->
}
}
defaults {
- publishConfigs('archives')
+ if (!isRoot) publishConfigs('archives')
}
}
}
}
+
+bintray {
+ user = bintrayUser
+ key = bintrayApiKey
+
+ configurations = ['archives']
+
+// dryRun = true //[Default: false] Whether to run this as dry-run, without deploying
+ publish = true //[Default: false] Whether version should be auto published after an upload
+ override = false //[Default: false] Whether to override version artifacts already published
+ //Package configuration. The plugin will use the repo and name properties to check if the package already exists. In that case, there's no need to configure the other package properties (like userOrg, desc, etc).
+ pkg {
+ repo = 'datadog-maven'
+ name = 'dd-trace-java'
+ userOrg = 'datadog' //An optional organization name when the repo belongs to one of the user's orgs
+ desc = 'Client libraries for Datadog APM'
+ websiteUrl = 'https://github.com/datadog/dd-trace-java'
+ issueTrackerUrl = 'https://github.com/datadog/dd-trace-java/issues'
+ vcsUrl = 'https://github.com/datadog/dd-trace-java.git'
+ licenses = ['Apache-2.0']
+
+ githubRepo = 'datadog/dd-trace-java' //Optional Github repository
+ githubReleaseNotesFile = 'README.md' //Optional Github readme file
+
+// //Optional version descriptor
+// version {
+// name = '1.3-Final' //Bintray logical version name
+// desc = //Optional - Version-specific description'
+// released = //Optional - Date of the version release. 2 possible values: date in the format of 'yyyy-MM-dd'T'HH:mm:ss.SSSZZ' OR a java.util.Date instance
+// vcsTag = '1.3.0'
+// attributes = ['gradle-plugin': 'com.use.less:com.use.less.gradle:gradle-useless-plugin']
+// //Optional version-level attributes
+// //Optional configuration for GPG signing
+// gpg {
+// sign = true //Determines whether to GPG sign the files. The default is false
+// passphrase = 'passphrase' //Optional. The passphrase for GPG signing'
+// }
+// //Optional configuration for Maven Central sync of the version
+// mavenCentralSync {
+// sync = true //[Default: true] Determines whether to sync the version to Maven Central.
+// user = 'userToken' //OSS user token: mandatory
+// password = 'paasword' //OSS user password: mandatory
+// close = '1'
+// //Optional property. By default the staging repository is closed and artifacts are released to Maven Central. You can optionally turn this behaviour off (by puting 0 as value) and release the version manually.
+// }
+// }
+ }
+}

Add bintray publishing

to bypass permission problem in promoting from oss artifactory.