java - eclipse中的spring petclinic编译错误

标签 java eclipse spring maven spring-mvc

从 github 下载了 spring petclinic 示例,并在 Eclipse 中将其作为现有 Maven 项目打开,但由于编译错误而失败。 java版本是1.7.0.51,pom.xml中的spring版本是4.1.1.RELEASE。

编译错误是:- 该项目未构建,因为其构建路径不完整。找不到 org.hamcrest.core.CombinableMatcher$CombinableBothMatcher 的类文件。修复构建路径,然后尝试构建此项目

无法解析类型 org.hamcrest.core.CombinableMatcher$CombinableBothMatcher。它是从所需的.class文件间接引用的

请让我知道您的建议。谢谢

最佳答案

尝试将其添加到您的 pom 依赖项中:

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

关于java - eclipse中的spring petclinic编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27152769/

相关文章:

java - 如何在按钮中使用模数并设置点击限制?

java - 机器上有很多 ip 地址,设置传出 ip java

java - Spring数据JPA/Hibernate "Unable to locate Attribute with the given name"

java - 错误 : Attempted to call method "format" on null context object

java - 使用 JavaFX 8 创建 null-safe BooleanBinding

java - ClassCastException 与 Hibernate ManyToMany 连接查询

Java:猜谜游戏错误计数

java - Eclipse中的代码分析

android - 如何捕获Android应用程序最终用户的IP地址

Eclipse 错误 : This project has the JPA facet, 但无法创建 JPA 项目