NoSuchMethodError with Hamcrest 1.3 & JUnit 4.11

前端 未结 8 1380
独厮守ぢ
独厮守ぢ 2020-12-30 19:03

Another instance of the NoSuchMethodError for the JUnit & Hamcrest combination. Offending code:

assertThat(dirReader.document(0).getFields()         


        
8条回答
  •  星月不相逢
    2020-12-30 19:24

    Using David's tip and How do I split a string on a delimiter in Bash? resulted in the following bash script:

    ( IFS=":"; for i in `mvn dependency:build-classpath | grep -v '\[INFO\]'`; do jar tf $i | awk "{print \"$i\\t\" \$1}"; done | grep Matcher )
    

    (online at http://www.kaspervandenberg.net/2013/scripts/findDependencyClass.sh)

    Which found that dependency JGlobus-Core-2.0.4 has its own versions of org.hamcrest.BaseMatcher, org.hamcrest.CoreMatchers, and org.hamcrest.Matcher.

提交回复
热议问题