빌드까지 성공했는데 왜 안되는 것인가!!!!!!!!!!

상황 : 로컬 잘 돌아가고 git action 빌드까지 성공했으나 서버 깨져서 cloud watch log 확인.

Untitled

원인 : 'org.springframework.security.crypto.bcrypt.bcryptpasswordencoder' that could not be found.

방법 : 의존성 주입 방식 변경

Untitled

  1. SecurityConfig.java에 Bean을 등록해준다.
@Bean
public PasswordEncoder passwordEncoder() {
    return new BCryptPasswordEncoder();
}
  1. BCryptPasswordEncoder를 생성자로 주입하는 것 대신에

    @Autowired로 의존성을 주입해야 한다.