绝对没有任何问题。注释仍然可用,@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>
我没有spring-hateoas
在我的中定义明确的版本pom.xml
,但我的构建正在拉入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
用作父项目吗?