似乎当我添加spring-hateoas的依赖项时
<groupId>org.springframework.hateoas</groupId>
<artifactId>spring-hateoas</artifactId>
<version>0.13.0.RELEASE</version>以下类在类路径中不再可用
org.springframework.web.bind.annotation.RestController;我试图排除spring-hateoas的各种依赖项,但应用程序不再运行。
有没有人有幸在春天的鞋子里穿着春天的仇恨。
发布于 2014-06-26 16:11:58
绝对没有任何问题。@RestController注释仍然可用,您不需要做任何排除。
如果有帮助,我目前使用的是Spring Boot的1.0.2版本:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.0.2.RELEASE</version>
</parent>spring-boot-starter-web提供了@RestController
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>我没有在我的pom.xml中为spring-hateoas定义一个显式版本,但是我的构建引入了0.9.0.RELEASE
<dependency>
<groupId>org.springframework.hateoas</groupId>
<artifactId>spring-hateoas</artifactId>
</dependency>顺便说一下,我可以从Eclipse POM编辑器中看到,Spring HATEOAS正在定义对Spring 3.2.7的依赖关系。但是,spring-boot-starter-parent项目管理4.0.3之前的版本。你能看到你得到的是什么版本的Spring吗?您是否没有将spring-boot-parent用作父项目?
https://stackoverflow.com/questions/24422371
复制相似问题