title: Unable to import Spring RepositoryRestResource
body: <p>I am trying to implement a REST based MongoDB service through Spring, but I have run into some trouble. I cannot import a certain library. </p>
  
  <p>I have this in my class: </p>
  
  <pre><code>package main;
  
  import java.util.List;
  
  import org.springframework.data.mongodb.repository.MongoRepository;
  import org.springframework.data.repository.query.Param;
  import org.springframework.data.rest.core.annotation.RepositoryRestResource;
  
  @RepositoryRestResource(collectionResourceRel = "people", path = "people")
  public interface PersonRepository extends MongoRepository&lt;Person, String&gt; {
  
      List&lt;Person&gt; findByLastName(@Param("name") String name);
  
  }
  </code></pre>
  
  <p>But the <code>import org.springframework.data.rest.core.annotation.RepositoryRestResource;</code>
  is not working for some reason and is giving me the error: <code>The import org.springframework.data.rest cannot be resolved</code></p>
  
  <p>This is my maven pom.xml:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;UserRegistrationServices&lt;/groupId&gt;
      &lt;artifactId&gt;UserRegistrationServices&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
  
      &lt;!-- Inherit defaults from Spring Boot --&gt;
      &lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;1.2.5.RELEASE&lt;/version&gt;
      &lt;/parent&gt;
  
      &lt;properties&gt;
          &lt;java.version&gt;1.8&lt;/java.version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;!-- Get the dependencies of a web application --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-data-rest&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-data-mongodb&lt;/artifactId&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;!-- Spring Boot Maven Support --&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Also, I am directly following this guide: <a href="http://spring.io/guides/gs/accessing-mongodb-data-rest/" rel="noreferrer">http://spring.io/guides/gs/accessing-mongodb-data-rest/</a></p>
  
  <p>How can this be resolved? Thanks</p>