JAVA/Application

[Springboot] thymeleaf-extras-springsecurity5 dependency 못 읽어오는 문제

히어로맛쿠키 2023. 2. 3. 21:06

오류

'dependencies.dependency.version' for org.thymeleaf.extras:thymeleaf-extras-springsecurity5:jar is missing.

또는 

Unresolved dependency: 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5:jar:unknown'

또는

org.thymeleaf.extras:thymeleaf-extras-springsecurity5:jar:unknown was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced

 

 


해결

 

springboot 3.0 이상을 사용하는 상황에서

dependency에 version 정보를 넣어주었더니 의존성 등록이 정상적으로 되었다. 

 

cf. 아마 springboot 2.7.0에서는 version을 명시하지 않아도 돌아가는 것 같다.

 

<dependency>
    <groupId>org.thymeleaf.extras</groupId>
    <artifactId>thymeleaf-extras-springsecurity5</artifactId>
    <version>3.0.4.RELEASE</version>   // <= version 추가해주었더니 잘 읽어옴
</dependency>

 


참고자료

 

∨ 아래 글을 보면, 스프링부트 3.0 이상의 dependency 설정에서는 위와 같이 <version> 정보를 넣어 쓰고있다.

 반면 2.7.0 버전에서는 <version> 없이도 돌아가는 것 같다. (<= 실습 코드에서도 그러하다)

 

https://stackoverflow.com/questions/72677959/spring-thymeleaf-security-secauthentication-not-working

 

Spring thymeleaf security sec:authentication not working

I've searched a lot for this specific problem and currently no methods solving it worked for my project. I'm using spring-boot-starter security v.2.7.0 and thymeleaf-extras-springsecurity5. The pro...

stackoverflow.com

 

반응형