Abstract core dependencies for central management
MODIFY
dd-java-agent-ittests/dd-java-agent-ittests.gradle
dd-java-agent-ittests/dd-java-agent-ittests.gradle
@@ -5,10 +5,9 @@ dependencies {
testCompile project(':dd-trace-annotations')
testCompile project(':dd-trace')
- testCompile group: 'io.opentracing', name: 'opentracing-mock', version: '0.30.0'
- testCompile group: 'org.assertj', name: 'assertj-core', version: '3.6.2'
+ testCompile deps.opentracingMock
- testCompile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
+ testCompile deps.testLogging
testCompile group: 'org.mongodb', name: 'mongo-java-driver', version: '3.4.2'
testCompile group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.4.1.v20170120'

MODIFY
dd-java-agent/dd-java-agent.gradle
dd-java-agent/dd-java-agent.gradle
@@ -24,14 +24,14 @@ dependencies {
compile group: 'org.reflections', name: 'reflections', version: '0.9.11'
compile group: 'com.google.auto.service', name: 'auto-service', version: '1.0-rc3'
- compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
+ compile deps.slf4j
compile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25'
// ^ Generally a bad idea for libraries, but we're shadowing.
- testCompile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
+ testCompile deps.testLogging
+ testCompile deps.opentracingMock
testCompile group: 'org.mongodb', name: 'mongo-java-driver', version: '3.4.2'
- testCompile group: 'io.opentracing', name: 'opentracing-mock', version: '0.30.0'
testCompile(project(path: ':dd-java-agent:integrations:helpers', configuration: "shadow")) {
transitive = false

MODIFY
dd-java-agent/integrations/helpers/helpers.gradle
dd-java-agent/integrations/helpers/helpers.gradle
@@ -9,7 +9,7 @@ configurations.compile {
dependencies {
compileOnly project(':dd-trace')
compileOnly project(':dd-trace-annotations')
- compileOnly group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
+ compileOnly deps.slf4j
compileOnly group: 'org.jboss.byteman', name: 'byteman', version: '4.0.0-BETA5'

MODIFY
dd-trace-annotations/dd-trace-annotations.gradle
dd-trace-annotations/dd-trace-annotations.gradle
@@ -4,6 +4,6 @@ apply from: "${rootDir}/gradle/jacoco.gradle"
description = 'dd-trace-annotations'
dependencies {
- compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
- testCompile group: 'junit', name: 'junit', version: '3.8.1'
+ compile deps.slf4j
+ testCompile deps.junit
}

MODIFY
dd-trace-examples/dropwizard-mongo-client/dropwizard-mongo-client.gradle
dd-trace-examples/dropwizard-mongo-client/dropwizard-mongo-client.gradle
@@ -17,8 +17,7 @@ dependencies {
compile project(':dd-trace')
compile project(':dd-trace-annotations')
- compile group: 'io.opentracing', name: 'opentracing-api', version: '0.30.0'
- compile group: 'io.opentracing', name: 'opentracing-util', version: '0.30.0'
+ compile deps.opentracing
compile group: 'io.dropwizard', name: 'dropwizard-core', version: '0.9.2'
compile group: 'org.mongodb', name: 'mongo-java-driver', version: '3.4.2'

MODIFY
dd-trace-examples/rest-spark/rest-spark.gradle
dd-trace-examples/rest-spark/rest-spark.gradle
@@ -19,8 +19,7 @@ dependencies {
compile 'com.sparkjava:spark-core:2.6.0'
compile 'org.mongodb:mongodb-driver:3.4.2'
- compile 'io.opentracing:opentracing-api:0.30.0'
- compile 'io.opentracing:opentracing-util:0.30.0'
+ compile deps.opentracing
compile 'io.opentracing.contrib:opentracing-mongo-driver:0.0.3'
compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'

MODIFY
dd-trace-java.gradle
dd-trace-java.gradle
@@ -16,10 +16,13 @@ plugins {
allprojects {
group = 'com.datadoghq'
version = '0.2.3-SNAPSHOT'
+
+ apply from: "${rootDir}/gradle/dependencies.gradle"
}
repositories {
jcenter()
+ mavenCentral()
}
description = 'dd-trace-java'

MODIFY
dd-trace/dd-trace.gradle
dd-trace/dd-trace.gradle
@@ -19,18 +19,15 @@ whitelistedInstructionClasses += whitelistedBranchClasses += [
]
dependencies {
- compile group: 'io.opentracing', name: 'opentracing-api', version: '0.30.0'
- compile group: 'io.opentracing', name: 'opentracing-noop', version: '0.30.0'
- compile group: 'io.opentracing', name: 'opentracing-util', version: '0.30.0'
+ compile deps.opentracing
compile group: 'io.opentracing.contrib', name: 'opentracing-tracerresolver', version: '0.1.0'
- compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.8'
- compile group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.8.8'
- compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
+ compile deps.jackson
+ compile deps.slf4j
compile group: 'com.google.auto.service', name: 'auto-service', version: '1.0-rc3'
compile group: 'org.msgpack', name: 'jackson-dataformat-msgpack', version: '0.8.13'
- testCompile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
+ testCompile deps.testLogging
testCompile group: 'org.objenesis', name: 'objenesis', version: '2.6'
testCompile group: 'cglib', name: 'cglib-nodep', version: '3.2.5'

ADD
gradle/dependencies.gradle
+ext {
+ version = [
+ opentracing: '0.30.0',
+
+ slf4j : "1.7.25",
+ guava : "21.0",
+ jackson : "2.8.7",
+
+ spock : "1.0-groovy-2.4",
+ groovy : "2.4.11",
+ junit : "4.12",
+ logback : "1.2.3",
+ ]
+
+ deps = [
+ // OpenTracing
+ opentracingApi : dependencies.create(group: 'io.opentracing', name: 'opentracing-api', version: version.opentracing),
+ opentracing : [
+ dependencies.create(group: 'io.opentracing', name: 'opentracing-api', version: version.opentracing),
+ dependencies.create(group: 'io.opentracing', name: 'opentracing-noop', version: version.opentracing),
+ dependencies.create(group: 'io.opentracing', name: 'opentracing-util', version: version.opentracing),
+ ],
+ opentracingMock: dependencies.create(group: 'io.opentracing', name: 'opentracing-mock', version: version.opentracing),
+
+ // General
+ slf4j : "org.slf4j:slf4j-api:${version.slf4j}",
+ guava : "com.google.guava:guava:$version.guava",
+ jackson : [
+ dependencies.create(group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: version.jackson),
+ dependencies.create(group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: version.jackson),
+ ],
+
+ // Testing
+ spock : dependencies.create("org.spockframework:spock-core:${version.spock}", {
+ exclude group: "org.codehaus.groovy", module: "groovy-all"
+ }),
+ groovy : "org.codehaus.groovy:groovy-all:${version.groovy}",
+ junit : "junit:junit:${version.junit}",
+ testLogging : [
+ dependencies.create(group: 'ch.qos.logback', name: 'logback-classic', version: version.logback),
+ dependencies.create(group: 'org.slf4j', name: 'log4j-over-slf4j', version: version.slf4j),
+ dependencies.create(group: 'org.slf4j', name: 'jcl-over-slf4j', version: version.slf4j),
+ dependencies.create(group: 'org.slf4j', name: 'jul-to-slf4j', version: version.slf4j),
+ ],
+ ]
+}

MODIFY
gradle/java.gradle
gradle/java.gradle
@@ -16,19 +16,20 @@ task packageSources(type: Jar) {
from sourceSets.main.allSource
}
artifacts.archives packageSources
+
repositories {
mavenLocal()
-
- maven { url "http://repo.maven.apache.org/maven2" }
+ jcenter()
+ mavenCentral()
}
dependencies {
- testCompile group: 'junit', name: 'junit', version: '4.12'
+ testCompile deps.junit
testCompile group: 'org.assertj', name: 'assertj-core', version: '3.6.2'
testCompile group: 'org.mockito', name: 'mockito-core', version: '2.7.22'
- testCompile group: 'org.spockframework', name: 'spock-core', version: '1.0-groovy-2.4'
- testCompile group: 'org.codehaus.groovy', name: 'groovy-all', version: '2.4.4'
+ testCompile deps.spock
+ testCompile deps.groovy
testCompile group: 'io.ratpack', name: 'ratpack-groovy-test', version: '1.4.6'
}

Abstract core dependencies for central management