【发布时间】:2021-11-23 08:23:26
【问题描述】:
当我添加依赖项时,Maven 依赖项中不存在一个依赖项(spring-context),如下所示:
到目前为止我所做的是:
项目 -> 清理 Maven ->更新 Maven 项目
并应用了这些步骤:
https://stackoverflow.com/a/9761685/12100307
pom.xml:
...<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>5.3.10</version>
<type>module</type>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.3.10</version>
<type>module</type>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context </artifactId>
<version>5.3.10</version>
<type>module</type>
</dependency>
</dependencies>...
【问题讨论】:
-
这件事一直发生在我身上,大多数时候是 IDE 缓存的问题。我不知道如何在 Eclipse 中做到这一点,但在 intellij 中你可以简单地
invalidate caches and restart. -
<type>module</type>是什么?删除它......并在普通命令上重建......
标签: java spring maven dependencies spring-framework-beans