弹簧引导与春天HATEOAS Maven冲突

时间:2014-06-26 04:26:31

标签: spring-boot spring-hateoas

当我添加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的各种依赖项,但APP不再运行。

有没有人在春季靴子里运行spring-hateoas有运气。

1 个答案:

答案 0 :(得分:1)

绝对没有任何问题。 @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用作父项目?

相关问题