izyj / mockito

Automatically exported from code.google.com/p/mockito
0 stars 0 forks source link

Hamcrest class conflicts #459

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. include mockito-all:1.9.5, junit:4.11, hamcrest-library:1.3.0
2. Intermittently causes "java.lang.NoSuchMethodError: 
org.hamcrest.Matcher.describeMismatch(java/lang/Object;Lorg/hamcrest/Description
)"
3.

What is the expected output? What do you see instead?
No Exception should be thrown, Mockito should NOT package Hamcrest classes in 
its own jar, this obsolete version can not be managed through a build tool 
(Maven, Gradle, etc).  It is simply a bad practice!

What version of the product are you using? On what operating system?
mockito-all:1.9.5, junit:4.11, hamcrest-library:1.3.0
Windows & Mac

Please provide any additional information below.
As a workaround, which is an unreliable hack is to put the hamcrest-library jar 
at the top of the maven dependencies.  Clearly, this is not the optimal 
solution.  Mockito MUST not include other project's packages, it is 
unmanageable!

Original issue reported on code.google.com by gordondi...@gmail.com on 30 Oct 2013 at 4:41

GoogleCodeExporter commented 8 years ago
Any updates? 

Original comment by imamon...@griddynamics.com on 21 Nov 2013 at 8:37

GoogleCodeExporter commented 8 years ago

Original comment by brice.du...@gmail.com on 4 Dec 2013 at 1:51

GoogleCodeExporter commented 8 years ago
Indeed hamcrest update is becoming more urgent as many project now use an 
updated version.

By the way if you have a pull request on github it would be awesome.

Original comment by brice.du...@gmail.com on 4 Dec 2013 at 1:53

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Pull request - https://github.com/mockito/mockito/pull/27

Original comment by marcin.g...@gmail.com on 17 Dec 2013 at 11:58

GoogleCodeExporter commented 8 years ago
Travis build passes for the pull request

Original comment by marcin.g...@gmail.com on 19 Dec 2013 at 4:11

GoogleCodeExporter commented 8 years ago

Original comment by brice.du...@gmail.com on 24 Dec 2013 at 11:54