Fix jar uploading to use shadow jar instead of default
Rename default jar to be explicit that no dependencies are embedded.
MODIFY
.circleci/config.yml
.circleci/config.yml
@@ -14,7 +14,7 @@ jobs:
- run:
name: Run Tests
- command: ./gradlew clean shadowJar check --parallel
+ command: ./gradlew clean check --parallel
- save_cache:
paths:

MODIFY
dd-java-agent-ittests/dd-java-agent-ittests.gradle
dd-java-agent-ittests/dd-java-agent-ittests.gradle
@@ -37,7 +37,7 @@ dependencies {
test {
jvmArgs "-Ddd.trace.configurationFile=${project.buildDir}/resources/test/dd-trace.yaml"
- jvmArgs "-javaagent:${project(':dd-java-agent').buildDir}/libs/dd-java-agent-${project.version}-shadow.jar"
+ jvmArgs "-javaagent:${project(':dd-java-agent').buildDir}/libs/dd-java-agent-${project.version}.jar"
jvmArgs "-Dorg.jboss.byteman.verbose=true"
}

MODIFY
dd-java-agent/dd-java-agent.gradle
dd-java-agent/dd-java-agent.gradle
@@ -71,6 +71,8 @@ dependencies {
}
jar {
+ classifier = 'unbundled'
+
manifest {
attributes(
// I don't think we want to define this since we can't really load after startup:
@@ -88,16 +90,15 @@ jar {
shadowJar {
append 'otarules.btm'
- classifier 'shadow'
+ classifier null
// mergeServiceFiles()
// Various tests fail when these are uncommented:
-// relocate 'ch.qos.logback', 'dd.deps.ch.qos.logback'
// relocate 'com.google', 'dd.deps.com.google'
// relocate 'org.jboss.byteman', 'dd.deps.org.jboss.byteman'
-// relocate 'org.slf4j', 'dd.deps.org.slf4j'
+ // Don't relocate slf4j or opentracing deps.
relocate 'com.fasterxml', 'dd.deps.com.fasterxml'
relocate 'javassist', 'dd.deps.javassist'
relocate 'org.reflections', 'dd.deps.org.reflections'

MODIFY
dd-trace/dd-trace.gradle
dd-trace/dd-trace.gradle
@@ -36,11 +36,16 @@ dependencies {
jmh 'commons-io:commons-io:2.4'
}
+jar {
+ classifier = 'unbundled'
+}
+
shadowJar {
// mergeServiceFiles()
- classifier 'shadow'
+ classifier null
+ // Don't relocate slf4j or opentracing deps.
relocate 'com.fasterxml', 'dd.deps.com.fasterxml'
relocate 'com.google', 'dd.deps.com.google'
relocate 'javassist', 'dd.deps.javassist'

MODIFY
gradle/java.gradle
gradle/java.gradle
@@ -17,7 +17,6 @@ tasks.withType(Javadoc) {
options.encoding = "utf-8"
options.docEncoding = "utf-8"
options.charSet = "utf-8"
- exclude "**/internal/**"
options.addStringOption('Xdoclint:none', '-quiet')
@@ -51,10 +50,19 @@ task javaDocJar(type: Jar, dependsOn: javadoc) {
}
artifacts {
- archives jar
archives sourceJar
archives javaDocJar
}
+if (project.plugins.hasPlugin('com.github.johnrengelman.shadow')) {
+ // Remove the no-deps jar from the archives to prevent publication
+ configurations.archives.with {
+ artifacts.remove artifacts.find { it.archiveTask.is jar }
+ }
+ artifacts {
+ archives shadowJar
+ }
+}
+
apply from: "$rootDir/gradle/checkstyle.gradle"
apply from: "$rootDir/gradle/codenarc.gradle"

ADD
gradle/util.gradle
+task artifacts {
+ group = "Help"
+ description = "Displays the artifacts associated with each configuration of " + project
+ doFirst {
+ configurations.findAll().each { config ->
+ println "${config}:"
+ config.allArtifacts.getFiles().each { file ->
+ println " " + file
+ }
+ println ' '
+ }
+ }
+}

Fix jar uploading to use shadow jar instead of default

Rename default jar to be explicit that no dependencies are embedded.