2017-07-15 41 views
1

我有以下問題:ClassNotFoundException的使用Spring WebFlux安全

我試圖建立含春Webflux和春季安全基本春天啓動(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> 

SpringSecurityConfig:

@EnableWebFluxSecurity 
public class SecurityConfig extends WebFluxSecurityConfiguration {} 

我沒有得到任何進一步的,因爲我得到的啓動異常:

Caused by: java.lang.ClassNotFoundException: org.springframework.security.web.server.context.SecurityContextRepository 

所以我認爲整個org.springframework.security.web.server包是不是在cla sspath,雖然它應該在那裏,因爲它包含在API docs中。

似乎我做錯了什麼,但我不知道是什麼。

+0

你要添加的依賴。 Afaik安全助焊劑罐不是'spring-boot-starter-security'的一部分。如果是嘗試清除本地存儲庫並重新下載依賴關係。 –

+0

你說得對,它不是它的一部分。我期待這是因爲它包含在Spring Security 5.0.0.M2 API文檔中。謝謝! – Roen

+1

你能回答你自己的問題嗎?這應該有助於社區中的其他開發人員。 –

回答

相關問題