java.lang.ClassNotFoundException : org. hamcrest.Matchers 添加依赖项后 pom.xml

标签 java xml spring soap

当我启动 soap 服务应用程序时,我从控制台收到此错误

java.lang.ClassNotFoundException: org.hamcrest.Matchers

经过研究,我已经将这三个依赖添加到pom.xml中,但启动应用程序仍然存在错误

<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>
         <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
            <version>1.3</version>
            <scope>test</scope>
         </dependency>

感谢收到的任何帮助。

最佳答案

你能试试下面的吗:

<dependency>
    <groupId>org.hamcrest</groupId>
    <artifactId>hamcrest-all</artifactId>
    <version>1.3</version>        
</dependency>

关于java.lang.ClassNotFoundException : org. hamcrest.Matchers 添加依赖项后 pom.xml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41984727/

相关文章:

java - 从接口(interface)实例化的对象是什么

java - 如何修复java中字符串分割的索引越界异常?

Java-将数组中的字符串转换为 double

xml - XSLT 格式日期

iphone - UITableView 不显示解析的数据

java - Spring程序化事务管理警告?

java - 如何在 Spring MVC REST channel 中获取登录的用户名/主体?

c# - XML XDocument - 似乎没有元素

java - Jersey + Spark javax.ws.rs.core.UriBuilder.uri

java - 如何停止@Bean注释的Kstream kafka消费者并继续运行spring-boot应用程序