我想把thymleaf-extras-springsecurity添加到我的项目中。
但是当我实现它的时候,它是错误的:
无法解析org.thymeleaf.extras:thymeleaf-extras-springsecurity 5:2.1.3.版本。
无法解析通信。nimbusds:oauth2-oidc-sdk:9.38.1。
我的build.gradle文件:
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()
}
1条答案
按热度按时间fkvaft9z1#
Thymeleaf Extras Security 5与Spring Security 6不兼容,您应该使用Thymeleaf Extras Security 6。
请记住,您使用的是Sping Boot 的SNAPSHOT版本:3.0.0-SNAPSHOT,这意味着它至少需要JDK 17。