问题描述
我在有线测试中添加了hamcrest方法,在构建过程中成功了。
但是当我尝试执行测试时,它抛出了java.lang.NoClassDefFoundError: org/hamcrest/Matchers
错误。
我尝试如下将hamcerst依赖项添加到package pom中(即使该依赖项已存在于父pom中):
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<scope>test</scope>
</dependency>
但是在运行时我仍然遇到相同的NoClassDefFoundError
错误。为什么呢?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)