From 96d596802b5ee06e0bd0ebba63b441396a94f696 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Thu, 4 Dec 2014 17:53:35 +0900 Subject: [PATCH] Fix dependency issues with hamcrest Motivation: We use 3 (!) libraries to build mock objects - easymock, mockito, jmock. Mockito and jMock pulls in the different versions of Hamcrest, and it conflicts with the version pulled by jUnit. Modifications: - Replace mockito-all with mockito-core to avoid pulling in outdated jUnit and Hamcrest - Exclude junit-dep when pulling in jmock-junit4, because it pulls an outdated Hamcrest version - Pull in the hamcrest-library version used by jUnit explicitly Result: No more dependency hell that results in NoSuchMethodError during the tests --- codec-mqtt/pom.xml | 6 ------ handler/pom.xml | 5 ----- pom.xml | 26 ++++++++++++++++++++++++-- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/codec-mqtt/pom.xml b/codec-mqtt/pom.xml index 22fce670ac..fa634af164 100644 --- a/codec-mqtt/pom.xml +++ b/codec-mqtt/pom.xml @@ -34,11 +34,5 @@ netty-codec ${project.version} - - - org.mockito - mockito-all - test - diff --git a/handler/pom.xml b/handler/pom.xml index ee5bbd7289..dbf9c543d6 100644 --- a/handler/pom.xml +++ b/handler/pom.xml @@ -77,11 +77,6 @@ provided true - - org.mockito - mockito-all - test - diff --git a/pom.xml b/pom.xml index c0b7ba650a..c03a77d73d 100644 --- a/pom.xml +++ b/pom.xml @@ -638,6 +638,12 @@ 4.11 test + + org.hamcrest + hamcrest-library + 1.3 + test + org.easymock easymock @@ -655,11 +661,17 @@ jmock-junit4 2.6.0 test + + + junit + junit-dep + + org.mockito - mockito-all - 1.9.5 + mockito-core + 1.10.8 test @@ -715,6 +727,11 @@ junit test + + org.hamcrest + hamcrest-library + test + org.easymock easymock @@ -730,6 +747,11 @@ jmock-junit4 test + + org.mockito + mockito-core + test + ch.qos.logback logback-classic