Home > database >  How to disable hal browser in Spring Boot data rest
How to disable hal browser in Spring Boot data rest

Time:08-22

I Don't have HAL browser or explorer in my dependencies. But it was already enable in root of my project: http:127.0.0.1:8080/ or http:127.0.0.1:8080/profile

How can I remove or disable HAL?

Here is my dependencies in pom.xml :

<dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-mongodb</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <version>5.6.2</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
</dependencies>

CodePudding user response:

Did you try clean install on maven ? If problem not solved and if you are using Intellij, then left top, click File invalidate cache restart (tick on clear file also). Last option is delete .m2 folder.

https://mkyong.com/maven/where-is-maven-local-repository/

CodePudding user response:

In general hal browser is pluggged into your apllication with this dependency:

<dependency>
  <groupId>org.springframework.data</groupId> 
  <artifactId>spring-data-rest-hal-explorer</artifactId>
  <version>3.4.1.RELEASE</version>
</dependency>

The version might be different but it has to be available for the appication in runtime Probably it somehow finds its way into your dependency list

To examine where exactly does this particular dependency come from, run mvn dependency:tree and find it in the produced tree. Then you should decide whether you can just remove the dependency "as is" or use exclusions mechanism of the build tool in case of transitivity

  • Related