Configuring pom.xml for Spring Data JPA

Now, we need to put the correct dependencies to work with Spring Data JPA. There are a couple of dependencies to configure in our pom.xml file.

The first one is the Spring Data JPA Starter, which provides a lot of auto-configuration classes which permits us to bootstrap the application quickly. The last one is the PostgreSQL JDBC driver, and it is necessary because it contains the JDBC implementation classes to connect with the PostgreSQL database. 

The new dependencies are:

<dependency>  <groupId>org.springframework.boot</groupId>  <artifactId>spring-boot-starter-data-jpa</artifactId></dependency><dependency>  <groupId>org.postgresql</groupId>  <artifactId>postgresql</artifactId>  <version>42.1.4</version> ...

Get Spring 5.0 By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.