Skip to content
Advertisement

Not able to add JPA dependency into spring-boot project

I am trying to add JPA Maven dependency to already created spring-boot project but I am getting following error:

JavaScript

When I remove it the error is gone.

pom.xml

JavaScript

application.properties

JavaScript

I tried to find answer online but none was solution for me.

Also tried to create > Spring starter project > an there immediately add JPA, Web and H2 but still same error.

I am using STS IDE, is something related to it maybe?

Advertisement

Answer

JavaScript

Is itself a demo project with an extending SpringBoot class as the main class of your project. But this dependency does the same :

JavaScript

So there is high chances that both will clash… The solution is to import the correct dependency for jpa and not the spring boot starter jpa dependency.

EDIT

This one might do the trick instead :

JavaScript

But I recommend you read the official documents to get started properly : https://docs.spring.io/spring-data/jpa/docs/2.1.0.RC2/reference/html/

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement