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をdepenceiesに追加すれば使える。

以下、解決後の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'

}

結果