From 6784611cff517d05348066f85b5745ef693d8646 Mon Sep 17 00:00:00 2001 From: "R. Tyler Croy" Date: Sat, 13 Dec 2014 17:44:19 -0800 Subject: [PATCH] Drop in a ZK dependency to deal with dependency issues I was having With ZK 3.4.6 which was the default dependency we were pulling in before this would happen: java.lang.NoClassDefFoundError: org/apache/zookeeper/Watcher at java.lang.Class.privateGetDeclaredMethods(Class.java:2693) at java.lang.Class.privateGetPublicMethods(Class.java:2894) at java.lang.Class.getMethods(Class.java:1607) at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46) at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33) at org.codehaus.groovy.classgen.asm.BytecodeHelper.box(BytecodeHelper.java:602) at offtopic.curator.CuratorClient.(CuratorClient.groovy:14) at offtopic.curator.CuratorClientInitializationSpec.with a valid String(CuratorClientSpec.groovy:23) Caused by: java.lang.ClassNotFoundException: org.apache.zookeeper.Watcher at java.net.URLClassLoader$1.run(URLClassLoader.java:372) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.net.URLClassLoader.findClass(URLClassLoader.java:360) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 8 more --- build.gradle | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index 45d8c18..d8f64b1 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ plugins { apply plugin: 'groovy' //////////////////////////////////////////////////////////////////////////////// -version = '0.1.1' +version = '0.2.0' group = 'offtopic' description =' Offtopic is a simple web application built with Ratpack for inspecting and consuming events from Kafka.' sourceCompatibility = '1.8' @@ -34,26 +34,23 @@ dependencies { /* Needed for discovering brokers and all kinds of other things in * Zookeeeper */ - compile 'org.apache.curator:curator-framework:2.7.0+' + compile 'org.apache.curator:curator-framework:2.7.+' compile 'org.apache.commons:commons-pool2:2.2+' compile 'org.apache.kafka:kafka_2.10:0.8.1.1+' - - compile 'org.slf4j:log4j-over-slf4j:1.7.6' - compile 'org.slf4j:slf4j-simple:1.7.6' + // Forcing us up to ZK 3.5 to prevent wacky classpath errors when mixing + // and matching dependencies + compile 'org.apache.zookeeper:zookeeper:3.5.+' testCompile 'org.spockframework:spock-core:0.7-groovy-2.0' testCompile 'cglib:cglib-nodep:2.2.+' } //////////////////////////////////////////////////////////////////////////////// -configurations { - compile.exclude module: 'log4j' - compile.exclude module: 'slf4j-log4j12' -} - test { testLogging { events "passed", "skipped", "failed", "standardOut", "standardError" } } + +// vim: ft=groovy