Rol*_*ndo 24 rest spring maven
我错过了什么依赖?我目前正在使用:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
我得到的错误是:导入org.springframework.web.bind无法解析
MAC*_*MAC 49
我有同样的问题.花了好几个小时之后,我遇到了一个解决方案,我已经添加了对" spring-webmvc "的依赖,但错过了" spring-web ".因此,只需添加以下依赖项即可解决此问题.如果您已经拥有,只需更新到最新版本.它肯定会起作用.
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
要使用的版本应为"5.1.2"或最新版本.我使用4.1.6并且构建失败,因为这个版本是旧版本
小智 24
这个解决方案工作,我遇到了同样的问题,经过几个小时我才发现:
(1)转到你的pom.xml
(2)添加这个依赖项:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
(3)运行你的项目
小智 8
问题实际上是由依赖性引起的。我花了一整天来解决这个问题。首先,右键单击项目> Maven > 添加依赖项
在“EnterGroupId、ArtifactId 或 sha1....”框中,输入“org.springframework”。
然后,从下拉列表中,展开“spring-web”列表 > 选择最新版本的 jar 文件 > 单击“确定”。
完毕!!!