Getting “Unable to resolve persistence unit” error when building jar without IDE

后端 未结 1 1240
后悔当初
后悔当初 2021-01-15 13:20

When i run maven build command in intellij Idea , everything works perfectly . But when i try to run \"mvn clean package\" without IDE using maven console i get an error sa

相关标签:
1条回答
  • 2021-01-15 13:49

    This is a known-bug observed on spring-boot 1.4 versions, wasn't seen on 1.3.x versions as it was silently swallowed.

    As a workaround, you can switch-off spring-boot auto-configuration of Hibernate by adding the below changes.

    1. Add @EnableAutoConfiguration(exclude = HibernateJpaAutoConfiguration.class) to you application class
    2. spring.data.jpa.repositories.enabled=false to your application.properties/yml file

    Refer link for more details

    Hope this helps and good luck!

    0 讨论(0)
提交回复
热议问题