在Spring Data REST中无法使用Hal-Browser

在dependencyManagement中无法使用org.springframework.data:spring-data-rest-hal-browser。

执行dependencyManagement任务时,…

org.springframework.data:spring-data-rest-hal-browserは無い
代わりにorg.springframework.data:spring-data-rest-hal-explorer がある

看起来,似乎已经被org.springframework.data:spring-data-rest-hal-explorer所取代。
根据手册,好像可以使用org.springframework.data:spring-data-rest-hal-browser,但是……不太清楚。

因为没有特别要求,所以可以将org.springframework.data:spring-data-rest-hal-explorer添加到依赖项中就可以使用。

以下是解决后的build.gradle文件。

plugins {
    id 'java'
    id 'application'
    id 'maven'
    id "io.freefair.lombok" version "5.3.0"
    id "org.flywaydb.flyway" version "7.3.2"
    id "org.springframework.boot" version "2.4.1"
    id "io.spring.dependency-management" version "1.0.10.RELEASE"
}
dependencyManagement {
    imports {
        mavenBom org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES
    }
}
dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-web'

    implementation "org.springframework.boot:spring-boot-starter-data-jpa"
    implementation "org.springframework.boot:spring-boot-starter-data-rest"
    implementation "org.springframework.data:spring-data-rest-webmvc"
    implementation "org.springframework.data:spring-data-rest-hal-explorer"
//    implementation "org.springframework.data:spring-data-rest-hal-browser"
    annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"

    implementation "org.flywaydb:flyway-core"

    implementation "com.zaxxer:HikariCP:3.4.0"
    implementation group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '2.2.2'
    implementation "com.influxdb:influxdb-client-java:1.0.0"

    implementation group: 'commons-collections', name: 'commons-collections', version: '3.2.1'
    implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
    implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
    implementation group: 'ch.qos.logback', name: 'logback-core', version: '1.2.3'

    // ------------ test -------------
    testImplementation ('org.springframework.boot:spring-boot-starter-test:2.2.1.RELEASE') {
        exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
    }

    testImplementation 'com.h2database:h2'

}

结果

image.png
广告
将在 10 秒后关闭
bannerAds