在项目中依赖一个 spring-security 版本时, 发现未生效, 调用报错
由于项目是依赖了srpingBoot
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.3.1.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent>
只要加入spring-security的依赖, 哪怕指定了版本, 也会使用springBoot中的版本
找了半天, 发现把security的版本依赖放在maven的 dependencyManagement标签中即可