Java 找不到EnableOAuth2Sso批注的导入

Java 找不到EnableOAuth2Sso批注的导入,java,spring,spring-security,spring-security-oauth2,Java,Spring,Spring Security,Spring Security Oauth2,我尝试重复以下教程: 我有以下依赖项: dependencies { compile('org.springframework.boot:spring-boot-starter-web') testCompile('org.springframework.boot:spring-boot-starter-test') compile('org.springframework.boot:spring-boot-starter-security') compile(

我尝试重复以下教程:

我有以下依赖项:

dependencies {
    compile('org.springframework.boot:spring-boot-starter-web')
    testCompile('org.springframework.boot:spring-boot-starter-test')
    compile('org.springframework.boot:spring-boot-starter-security')
    compile("org.springframework.security.oauth:spring-security-oauth2:2.3.2.RELEASE")
    compile('org.springframework.boot:spring-boot-starter-thymeleaf')
    compile('org.thymeleaf.extras:thymeleaf-extras-springsecurity4:2.1.2.RELEASE')
}
我有以下课程:

import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

    @Configuration
    @EnableOAuth2Sso
    public class UiSecurityConfig extends WebSecurityConfigurerAdapter {

        @Override
        public void configure(HttpSecurity http) throws Exception {
            http.antMatcher("/**")
                    .authorizeRequests()
                    .antMatchers("/", "/login**")
                    .permitAll()
                    .anyRequest()
                    .authenticated();
        }
    }
如您所见,我没有导入
@enableAuth2sso
注释。而且Idea不建议我导入automcomplete

我做错了什么?

我替换了

 compile("org.springframework.security.oauth:spring-security-oauth2:2.3.2.RELEASE")

这个想法很重要

compile ("org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure:2.0.0.RELEASE")