我遇到以下问题:
我正在尝试设置一个包含 Spring Webflux 和 Spring Security 的基本 Spring Boot (2.0.0.M2) 项目。
我的 pom.xml 看起来像这样(通过 start.spring.io 生成):
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.M2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<dependencies>
...
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
...
</dependencies>
弹簧安全配置:
@EnableWebFluxSecurity
public class SecurityConfig extends WebFluxSecurityConfiguration {}
我没有进一步了解,因为我在启动时遇到异常:
Caused by: java.lang.ClassNotFoundException: org.springframework.security.web.server.context.SecurityContextRepository
所以我认为整个org.springframework.security.web.server
包不在类路径上,尽管它应该在那里,因为它包含在API 文档中。
好像我做错了什么,但我不知道是什么。