java.lang.NoClassDefFoundError: org/hamcrest/MatcherAssert 的解决办法

来源:互联网 发布:摩根币是网络传销吗 编辑:程序博客网 时间:2024/05/18 02:39
<dependency>  <groupId>junit</groupId>  <artifactId>junit</artifactId>  <version>4.12</version>  <scope>test</scope></dependency><dependency>  <groupId>org.hamcrest</groupId>  <artifactId>hamcrest-library</artifactId>  <version>1.3</version>  <scope>test</scope></dependency>

You should use hamcrest-library instead of hamcrest-all. hamcrest-all is not meant to be used with a dependency manager because it is an uber-jar that contains hamcrest-core and hamcrest-library. The following snippet should work.

JUnit throws java.lang.NoClassDefFoundError: org/hamcrest/MatcherAssert

阅读全文
0 0
原创粉丝点击