首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法找到/导入“io.rest-assured”包,即使在添加到Maven项目后也是如此

无法找到/导入“io.rest-assured”包,即使在添加到Maven项目后也是如此
EN

Stack Overflow用户
提问于 2020-09-09 02:38:56
回答 1查看 255关注 0票数 1

我已经将以下依赖项添加到maven项目的pom.xml文件中,并执行了一次mvn清理、安装。我可以在我的c驱动器/users中看到添加到.m2文件夹的依赖项,但它们没有列在IntelliJ的“外部库”部分下。此外,当我尝试将它们导入到类中时,我看不到它们,并且出现“找不到”错误。

已添加依赖项-

代码语言:javascript
复制
    <dependency>
        <groupId>io.rest-assured</groupId>
        <artifactId>json-path</artifactId>
        <version>3.3.0</version>
    </dependency>
  
    <dependency>
        <groupId>io.rest-assured</groupId>
        <artifactId>json-schema-validator</artifactId>
        <version>4.3.0</version>
    </dependency>

EN

回答 1

Stack Overflow用户

发布于 2020-09-14 10:57:13

我认为这可能是因为缺少<scope>。默认作用域是compile,如果未指定,则使用该作用域,但这里需要test

代码语言:javascript
复制
<dependency>
    <groupId>io.rest-assured</groupId>
    <artifactId>json-path</artifactId>
    <version>4.3.1</version>
    <scope>test</scope>
</dependency>

<dependency>
    <groupId>io.rest-assured</groupId>
    <artifactId>json-schema-validator</artifactId>
    <version>4.3.1</version>
    <scope>test</scope>
</dependency>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63799802

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档