I'm using Spring MVC and Spring Data JPA and facing with an exception of jar version.
This is my pom:
<properties>
<spring.version>4.2.4.RELEASE</spring.version>
<hibernate.version>4.3.8.Final</hibernate.version>
<mysql.version>5.1.10</mysql.version>
<junit-version>4.11</junit-version>
<servlet-api-version>3.1.0</servlet-api-version>
<spring-security-version>4.0.4.RELEASE</spring-security-version>
<spring-data-solr.verion>1.2.0.RELEASE</spring-data-solr.verion>
<springbatch.version>3.0.6.RELEASE</springbatch.version>
<jsp-version>2.1</jsp-version>
<jstl-version>1.2</jstl-version>
<java.version>1.7</java.version>
<liquibase.version>3.1.1</liquibase.version>
<spring.data.jpa.version>1.10.3.RELEASE</spring.data.jpa.version>
<spring.social.version>1.1.0.RELEASE</spring.social.version>
</properties>
This is my class:
import org.springframework.data.jpa.repository.JpaRepository;
public interface RoleRepository extends JpaRepository<Role, Long> {
}
I received an error warning on Eclipse with message:
The type org.springframework.data.repository.query.QueryByExampleExecutor cannot be resolved. It is indirectly referenced from required .class files
It seem my Spring data jpa jar version is incorrect, but I don't know find correct version. My Spring verion: 4.2.4.RELEASE is latest
How to fix this error? Thank so much !
Since you have a POM, it means you're using Maven, and Maven has a plugin called dependency on which you can call
dependency:list
that will list all your jar dependencies together with their versions.Just call at the root of your project (given that you're using a starter):
and you will list your jars:
You can also use
dependency:analyze-duplicate
,dependency:tree
ordependency:analyze-report
to check everything is declared once. Check the documentation for this plugin, it is really useful when you're facing dependencies issues.Here's a sample of dependency:tree:
On my MacBook Pro, I simply call in the Terminal:
The place to go to find the version compatibility is https://www.mvnrepository.com/ You put in your version and it will show the associated libs and their versions. Cool site. It will even show you how to enter your POM. For your spring data jpa, I entered "Spring data jpa" in the search, clicked on the library, then clicked on your version "1.10.3". If you scroll to the bottom, it will show the associated compile dependencies and their versions.