From ea7d4c49d77e22f9157b6c478a0cf80d052b7ff6 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Mon, 4 Jan 2016 16:47:37 +0800 Subject: [PATCH] Fixes IOException in jar -x on shadow jars The shadowJar plugin makes a single file out of all the dependencies of our services. Occasionally, this leads to file conflicts. Jackson's META-INF/LICENSE conflicts with the directory META-INF/license While we can run the shadowJars, you cannot extract them with `jar -x`, as it ends up with an IOException extracting META-INF/license. This excludes Jackson's META-INF/LICENSE, until we have a better solution, ideally with one of the proposals in the shadow jar project. See https://github.com/johnrengelman/shadow/pull/86 See https://github.com/johnrengelman/shadow/pull/102 --- zipkin-collector-service/build.gradle | 4 ++++ zipkin-query-service/build.gradle | 4 ++++ zipkin-web/build.gradle | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/zipkin-collector-service/build.gradle b/zipkin-collector-service/build.gradle index 98cf012fc28..52175a79138 100644 --- a/zipkin-collector-service/build.gradle +++ b/zipkin-collector-service/build.gradle @@ -15,6 +15,10 @@ jar.manifest.attributes 'Main-Class': mainClassName tasks.build.dependsOn(shadowJar) artifacts.zipkinUpload shadowJar +shadowJar { + exclude 'META-INF/LICENSE' // jackson's META-INF/LICENSE conflicts with the directory META-INF/license +} + dependencies { compile "com.twitter:finagle-ostrich4_${scalaInterfaceVersion}:${commonVersions.finagle}" compile "com.twitter:finagle-thriftmux_${scalaInterfaceVersion}:${commonVersions.finagle}" diff --git a/zipkin-query-service/build.gradle b/zipkin-query-service/build.gradle index 916973dbcd9..bf722f00901 100644 --- a/zipkin-query-service/build.gradle +++ b/zipkin-query-service/build.gradle @@ -15,6 +15,10 @@ jar.manifest.attributes 'Main-Class': mainClassName tasks.build.dependsOn(shadowJar) artifacts.zipkinUpload shadowJar +shadowJar { + exclude 'META-INF/LICENSE' // jackson's META-INF/LICENSE conflicts with the directory META-INF/license +} + dependencies { compile "com.twitter:finagle-ostrich4_${scalaInterfaceVersion}:${commonVersions.finagle}" compile "com.twitter:finagle-zipkin_${scalaInterfaceVersion}:${commonVersions.finagle}" diff --git a/zipkin-web/build.gradle b/zipkin-web/build.gradle index bbf03ecf739..4ec7c7d5be1 100644 --- a/zipkin-web/build.gradle +++ b/zipkin-web/build.gradle @@ -12,6 +12,10 @@ jar.manifest.attributes 'Main-Class': mainClassName tasks.build.dependsOn(shadowJar) artifacts.zipkinUpload shadowJar +shadowJar { + exclude 'META-INF/LICENSE' // jackson's META-INF/LICENSE conflicts with the directory META-INF/license +} + dependencies { compile project(':zipkin-common') compile "com.twitter:twitter-server_${scalaInterfaceVersion}:${commonVersions.twitterServer}"