我在学习春天,我迈出了我的第一步。我有一个学习计划。当我打开一个项目时,它写道:Java: package org.springframework.context不存在
我的项目- https://github.com/anatoliy19/2.1.4.git
我应该在我的项目中添加什么?
我pom.xml
4.0.0
<groupId>ru.javamentor</groupId>
<artifactId>spring-types-of-wiring</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.3.14</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.3.14</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>5.3.14</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scalatestplus</groupId>
<artifactId>junit-4-12_2.13</artifactId>
<version>3.2.2.0</version>
<scope>test</scope>
</dependency>
</dependencies>
您是否尝试执行
mvn clean install
命令?此外,maven的依赖项有时会损坏,因此需要删除.m2文件夹
的内容。c:usersusername.m2
,然后执行
mvn clean install
from your terminal