Ask Your Question
0

How can the unresolved import of org.springframework.data.jpa.repository.JpaRepository be resolved?

asked 2022-03-09 11:00:00 +0000

huitzilopochtli gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-11-19 05:00:00 +0000

ladyg gravatar image

The unresolved import of org.springframework.data.jpa.repository.JpaRepository can be resolved by adding the necessary dependencies in the project's build file (Maven or Gradle) and ensuring that the version used is compatible with the version of Spring being used.

For example, in a Maven project, you can add the following dependencies in the pom.xml file:

<dependency>
  <groupId>org.springframework.data</groupId>
  <artifactId>spring-data-jpa</artifactId>
  <version>VERSION</version>
</dependency>

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

In a Gradle project, you can add the following dependencies in the build.gradle file:

implementation 'org.springframework.boot:spring-boot-starter-data-jpa:VERSION'
implementation 'org.springframework.data:spring-data-jpa:VERSION'

After adding the dependencies, make sure to refresh the project and rebuild it to ensure that the new dependencies are taken into account.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-03-09 11:00:00 +0000

Seen: 14 times

Last updated: Nov 19 '21