首页 > 解决方案 > Eclipse 2021 Maven Spring Junit 构建失败

问题描述

我正在尝试使用 Eclipse-2021-03。用 Eclipse-Neon 在 maven 下构建的东西现在失败了。在 Eclipse-2021-03 中,maven 已经解决了这个依赖:

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-test</artifactId>
    <version>5.0.5.RELEASE</version>
    <scope>test</scope>
</dependency>

这可以在下图中看到,但我收到错误“无法解析导入 org.springframework.test”:

在此处输入图像描述

就是想不通为什么。帮助将不胜感激。谢谢。

标签: javaeclipsemavenspring-test

解决方案


答案就在这里;我在错误的地方寻找答案。显着的指标是 maven jar 旁边的灰色图标:Eclipse Maven dependency jar grayed out, can't import classes from it


推荐阅读