我在运行mvn install时收到包org.springframework.stereotype错误。即使在.m2文件夹中也有该软件包。
通过这行代码向我显示错误:
import org.springframework.stereotype.Service;
Run Code Online (Sandbox Code Playgroud)
依赖项是:
<springVersion>4.1.1.RELEASE</springVersion>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${springVersion}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${springVersion}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${springVersion}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${springVersion}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${springVersion}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${springVersion}</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
有什么我想念的吗?
更新
这是我得到的全部错误:
ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile (default-compile) on project mynewProject: Compilation failure: Compilation failure:
[ERROR] /C:/mynewProject/src/main/java/com/web/server/domain/service/WebServiceImpl.java:[17,38] package org.springframework.stereotype does not exist
[ERROR] /C:/mynewProject/src/main/java/com/web/server/domain/service/WebServiceImpl.java:[25,2] cannot find symbol
Run Code Online (Sandbox Code Playgroud) maven ×1