gpt4 book ai didi

maven - 无法访问在 Eclipse 和 Rest Assured 中找不到的 org.hamcrest.Matcher 的 org.hamcrest.Matcher 类文件

转载 作者:行者123 更新时间:2023-12-05 06:32:01 24 4
gpt4 key购买 nike

您好,我是新手,请放心并尝试在 BDD 中执行此操作,为此,我在尝试运行时编写了一个脚本,出现了下面提到的错误

[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/akrishnan/eclipse-workspace/BehavDD/src/Test/behaviourDrivenTest.java:[4,27] package org.hamcrest does not exist
[ERROR] /C:/Users/akrishnan/eclipse-workspace/BehavDD/src/Test/behaviourDrivenTest.java:[5,27] package org.hamcrest does not exist
[ERROR] /C:/Users/akrishnan/eclipse-workspace/BehavDD/src/Test/behaviourDrivenTest.java:[23,63] cannot find symbol
symbol: method hasSize(int)
location: class Test.behaviourDrivenTest
[ERROR] /C:/Users/akrishnan/eclipse-workspace/BehavDD/src/Test/behaviourDrivenTest.java:[22,29] cannot access org.hamcrest.Matcher
class file for org.hamcrest.Matcher not found
[ERROR] /C:/Users/akrishnan/eclipse-workspace/BehavDD/src/Test/behaviourDrivenTest.java:[38,41] cannot find symbol
symbol: method equalTo(java.lang.String)
location: class Test.behaviourDrivenTest
[ERROR] /C:/Users/akrishnan/eclipse-workspace/BehavDD/src/Test/behaviourDrivenTest.java:[53,28] cannot find symbol
symbol: method equalTo(java.lang.String)
location: class Test.behaviourDrivenTest
[ERROR] /C:/Users/akrishnan/eclipse-workspace/BehavDD/src/Test/behaviourDrivenTest.java:[68,63] cannot find symbol
symbol: method hasSize(int)
location: class Test.behaviourDrivenTest
[ERROR] /C:/Users/akrishnan/eclipse-workspace/BehavDD/src/Test/behaviourDrivenTest.java:[80,63] cannot find symbol
symbol: method hasSize(int)
location: class Test.behaviourDrivenTest
[ERROR] /C:/Users/akrishnan/eclipse-workspace/BehavDD/src/Test/behaviourDrivenTest.java:[128,73] cannot find symbol
symbol: method equalTo(java.lang.String)
location: class Test.behaviourDrivenTest
[ERROR] /C:/Users/akrishnan/eclipse-workspace/BehavDD/src/Test/behaviourDrivenTest.java:[149,63] cannot find symbol
symbol: method hasSize(int)
location: class Test.behaviourDrivenTest
[INFO] 10 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE

我也添加了maven依赖

<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.hamcrest/hamcrest-core -->
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.3</version>
<scope>test</scope>

我不知道我在这里错过了什么。即使我尝试使用外部 jar 设置构建路径,仍然没有用。

最佳答案

在我的例子中,我不得不移除示波器,因为我还在 scoupe 测试中使用了它。

关于maven - 无法访问在 Eclipse 和 Rest Assured 中找不到的 org.hamcrest.Matcher 的 org.hamcrest.Matcher 类文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51546165/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com