Home > Back-end >  Could not resolve org.thymeleaf.extras:thymeleaf-extras-springsecurity5:2.1.3.RELEASE
Could not resolve org.thymeleaf.extras:thymeleaf-extras-springsecurity5:2.1.3.RELEASE

Time:07-22

I want to add thymeleaf-extras-springsecurity to my project.

But when i implementation it, it is error:

Could not resolve org.thymeleaf.extras:thymeleaf-extras-springsecurity5:2.1.3.RELEASE.

Could not resolve com.nimbusds:oauth2-oidc-sdk:9.38.1.

My build.gradle file:

plugins {
    id 'org.springframework.boot' version '3.0.0-SNAPSHOT'
    id 'io.spring.dependency-management' version '1.0.12.RELEASE'
    id 'java'
}

group = 'ru.arisu'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17'

repositories {
    mavenCentral()
    maven { url 'https://repo.spring.io/milestone' }
    maven { url 'https://repo.spring.io/snapshot' }
    maven { url 'https://repo.spring.io/libs-release'}

}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    developmentOnly 'org.springframework.boot:spring-boot-devtools'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    implementation 'org.springframework.boot:spring-boot-starter-jdbc'
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'


    runtimeOnly 'org.postgresql:postgresql:42.3.1'

    implementation 'org.springframework.boot:spring-boot-starter-security'
    implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
    implementation 'org.springframework.security:spring-security-oauth2-client'
    implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5:2.1.3.RELEASE'

}

tasks.named('test') {
    useJUnitPlatform()
}

CodePudding user response:

Thymeleaf Extras Security 5 is not compatible with Spring Security 6, you should be using Thymeleaf Extras Security 6.

Remember that you are using a SNAPSHOT version of Spring Boot: 3.0.0-SNAPSHOT, which means that it requires JDK 17 at minimum.

  • Related