Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot resolve symbol WebSecurityConfigurerAdapter

I try created Basic Auth in my java app. For they i used this dependencies in gradle file

dependencies {
compile group: 'org.springframework.boot', name: 'spring-boot-starter', version: '1.5.9.RELEASE'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '1.5.9.RELEASE'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-parent', version: '1.3.3.RELEASE'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-security'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-log4j2', version: '1.4.3.RELEASE'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-mongodb', version: '1.5.9.RELEASE'
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.7'
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.7'
compile group: 'org.apache.logging.log4j', name: 'log4j-web', version: '2.7'
compile('org.hibernate:hibernate-core')    
testCompile group: 'junit', name: 'junit', version: '4.12'

}

When i implementation extend class WebSecurityConfigurerAdapter idea show error Cannot resolve symbol WebSecurityConfigurerAdapter and highlights code red color. enter image description here

I tryed also use next dependecies

compile group: 'org.springframework.boot', name: 'spring-security-core', version: '5.0.0.RELEASE'
compile group: 'org.springframework.boot', name: 'spring-security-web', version: '5.0.0.RELEASE'
compile group: 'org.springframework.boot', name: 'spring-security-config', version: '5.0.0.RELEASE'

What dependecies need to be gradle file for the implementation extended class WebSecurityConfigurerAdapter?

like image 335
user1854307 Avatar asked Jun 27 '26 03:06

user1854307


1 Answers

Refer to https://spring.io/blog/2022/02/21/spring-security-without-the-websecurityconfigureradapter.

I believe websecurityconfigureradapter is already removed in the latest spring boot library.

like image 148
ziqi li Avatar answered Jun 29 '26 14:06

ziqi li