我添加了this repository至pom.xml
,但是IntelliJ
无法解决org.springframework.boot.test
:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>2.2.4.RELEASE</version>
<scope>test</scope>
</dependency>
但是,将库添加到 classpath
后,它恰好有效:
这个存储库有什么特别之处,以至于我应该手动添加它?
编辑:
<scope></scope>
导致了这个问题。我不知道它实际上做了什么,它做了 IntelliJ
忽略我的main
目录。
最佳答案
从本地 Maven 存储库中手动删除它。如果仍然不起作用。将旧版本添加到 pom.xml。 希望能成功
关于spring - 无法使用范围测试的 Maven 依赖项解析 @SpringBootTest,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60331992/