在maven下用 junit4.12 的时候报错
java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing
此时需要添加依赖 hamcrest-all
<dependency> <groupId>org.hamcrest</groupId> <artifactId>hamcrest-all</artifactId> <version>1.3</version> <scope>test</scope> </dependency>
在maven下用 junit4.12 的时候报错
java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing
此时需要添加依赖 hamcrest-all
<dependency> <groupId>org.hamcrest</groupId> <artifactId>hamcrest-all</artifactId> <version>1.3</version> <scope>test</scope> </dependency>