所以我在让oauth2
在spring-boot.1.3.1.RELEASE
上工作时遇到了问题。
spring-boot
使用spring
4.2.4
,spring-security-oauth2.2.0.8
使用旧的4.0.9
版本。
这是一个maven
项目,一旦我添加了spring-security-oauth2
依赖项,我就无法启动tomcat
,因为它报告
No class definition error
Caused by: java.lang.NoClassDefFoundError: org/springframework/context/event/GenericApplicationListener
依赖关系层次结构在附加的图像中看起来像。
有没有办法让它们一起工作,或者我必须恢复到旧的spring-boot
版本?
依赖层次结构
好的,所以我通过在我的项目结构的父POM
中定义parent
来解决它
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.1.RELEASE</version>
</parent>
以前,我的maven
结构仅基于spring-boot-starter-web
和spring-security-oauth2
依赖关系。