danielbchaves
danielbchaves

Reputation: 113

How to know correctly package and version to use CrudRepository on spring

I am new with spring mvc (version 3.2.2.RELEASE), trying to build a project sample. I had a controller, working, reading data and parsing a json.

So I started to try to access and create data, and found about CrudRepository in a tutorial (https://spring.io/guides/gs/accessing-data-jpa/) that uses "spring-boot-starter-data-jpa"

My question is, how do I know which package contains CrudRepository and the version that I should use with my spring version? As far as I know "spring-boot-starter-data-jpa" is a group of jar, and I have a project that have spring already, so I would need just the CrudRepository artifact

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-tx</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>${spring.version}</version>
    </dependency>


    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-commons</artifactId>
        <version>1.9.2.RELEASE</version>
    </dependency>

Upvotes: 0

Views: 391

Answers (1)

Stefaan Neyts
Stefaan Neyts

Reputation: 2067

CrudRepository is part of Spring Data module.

So this dependency:

spring-data-commons

Here is a useful site to find the containing jar of almost any java class: GREPCODE.com:

http://grepcode.com/file/repo1.maven.org/maven2/org.springframework.data/spring-data-commons-core/1.1.0.RELEASE/org/springframework/data/repository/CrudRepository.java

Upvotes: 1

Related Questions