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

发布于 2020-09-14 10:57:13
我认为这可能是因为缺少<scope>。默认作用域是compile,如果未指定,则使用该作用域,但这里需要test。
<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>https://stackoverflow.com/questions/63799802
复制相似问题