问题
I'm having trouble finding which package contains @EnableWebSecurity in Spring Security 3.1.3. I've added core, config, web and ldap security packages, but the annotation remains unavailable. Has it been replaced by another annotation?
回答1:
I think java config support is not yet released with Spring Security, but available as a separate module in spring-security-javaconfig. See instructions in the linked page about how to include the jar into your maven build.
回答2:
I faced the same problem and was able to solve it by adding "spring-boot-starter-security" as a dependency in build.gradle as mentioned in the spring "Getting Started" guide available @ https://spring.io/guides/gs/securing-web/
来源:https://stackoverflow.com/questions/16105844/spring-security-3-1-3-enablewebsecurity