SpringBoot 集成JPA提示:
java.lang.NoClassDefFoundError:org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor
造成原因:spring-data-commons 模块依赖spring-orm 模块中的相关类文件。
补全依赖:
<!-- spring-data-jpa -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
<version>1.13.22.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>4.3.21.RELEASE</version>
</dependency>