未找到 WebSecurityConfigurerAdapter

yoo*_*uri 2 spring-mvc spring-security

我的 build.gradle 包含:

compile('org.springframework.security:spring-security-web:4.1.3.RELEASE')
Run Code Online (Sandbox Code Playgroud)

做了一个“刷新所有 gradle 项目”(我使用的是 IntelliJ!)

当我想扩展WebSecurityConfigurerAdapter它时说“创建类....”

WebSecurityConfigurerAdapter也找不到应该在哪里的命名空间...

http://docs.spring.io/spring-security/site/docs/current/apidocs/org/springframework/security/config/annotation/web/configuration/WebSecurityConfigurerAdapter.html

Vad*_*kyi 6

像这样添加 maven 依赖 spring 配置

<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-config</artifactId>
    <version>4.1.3.RELEASE</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

或下载 jar 并连接到您的项目