Method example of deploying spring boot as a jar package
preface
Keep tapping the code in the IDE and run the spring boot project using the command line MVN spring boot: run or gradlew bootrun. It should be easy to put it on prod. However, today I tried to solve all kinds of problems. The biggest error is the bug of 1.4:
Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method Failed; nested exception is javax. persistence. PersistenceException: Unable to resolve persistence unit root URL
This error made me think there was something wrong with my code. After looking for a long time, I didn't find it. Finally, I thought that since the command line can run OK, it must be wrong for a fat jar to fail. So I went to GitHub and thought the stone was sinking into the sea and ready to sleep. Unexpectedly, the members of the spring boot returned in seconds. The problem found is the automatic configuration of hibernate in version 1.4. I don't think I need hibernate at all. Just delete it.
GitHub original question: https://github.com/spring-projects/spring-boot/issues/6927