Я пытаюсь использовать библиотеку BCrypt, которую предоставляет spring.Я просмотрел много учебных пособий, но по какой-то странной причине почти никто из них не пытается показать, что должен содержать файл build.gradle для доступа к ним.В настоящее время у меня есть это:
dependencies {
....
compile group: 'org.springframework.security', name: 'spring-security-crypto', version: '5.0.8.RELEASE'
}
В моем фактическом Java-файле у меня есть это:
package project;
import org.springframework.security.config.annotation.web.configuration;
import org.springframework.security.crypto.password;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@ComponentScan
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Bean
public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
}
Тем не менее, я вижу эти ошибки при попытке собрать:
error: cannot find symbol import org.springframework.security.config.annotation.web.configuration;
^
symbol: class configuration
location: package org.springframework.security.config.annotation.web
error: package org.springframework.security.crypto does not exist
import org.springframework.security.crypto.password;
error: cannot find symbol public class SecurityConfig extends WebSecurityConfigurerAdapter {
^
symbol: class WebSecurityConfigurerAdapter
error: cannot find symbol
public PasswordEncoder passwordEncoder() {
^
symbol: class PasswordEncoder
location: class SecurityConfig
Какие зависимости я пропускаю и как я могу найти их, когда учебники пропускают их?