7

How can I disable Hibernate Envers in Spring Boot 2? I don't want to remove the dependency, because the code relies on it depending on the environment.

I tried the following properties in my application.properties but none worked. On startup it always prints envers enabled = true

spring.hibernate.integration.envers.enabled=false
hibernate.integration.envers.enabled=false
spring.jpa.hibernate.integration.envers.enabled=false
buræquete
  • 14,226
  • 4
  • 44
  • 89
Daniel
  • 834
  • 1
  • 9
  • 25

2 Answers2

12

Can you try;

spring.jpa.properties.hibernate.integration.envers.enabled=false

"Non-Spring Data JPA" Hibernate properties are configured through spring.jpa.properties.hibernate.* afaik. That might just do it!

buræquete
  • 14,226
  • 4
  • 44
  • 89
2

Actually there are two ways to disable hibernate envers in spring boot applications:

Wih VM Arguments:

-Dhibernate.integration.envers.enabled= false

With hibernate.properties (not application.properties) file, (if not exist, create) add the line below.

hibernate.integration.envers.enabled=false
cuneytykaya
  • 579
  • 1
  • 5
  • 14