title: Not able to use class by adding dependency in pom.xml until the jar is added in Java Build Path
body: <p>I am creating a project using maven with spring and hibernate. I added a dependency for using javax.persistence package in pom.xml like </p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
      &lt;artifactId&gt;ejb3-persistence&lt;/artifactId&gt;
      &lt;version&gt;1.0.2.GA&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>After adding this dependency tried to import the package javax.persistence but it didn't showed up. I then downloaded the jar file from mvnrepository related to that and then was able to obviously import the package. I guess, Maven handles the dependency and there should not have been any neccessity of downloading the jar and then adding it to the build path.</p>
  
  <p>Can someone explain where I went wrong?</p>
  
  <p>The .project file has the below content :</p>
  
  <pre><code>&lt;projectDescription&gt;
      &lt;name&gt;SampleWebApp&lt;/name&gt;
      &lt;comment&gt;This is the sample web app. NO_M2ECLIPSE_SUPPORT: Project files created  with the maven-eclipse-plugin are not supported in M2Eclipse.&lt;/comment&gt;
      &lt;projects/&gt;
      &lt;buildSpec&gt;
      &lt;buildCommand&gt;
          &lt;name&gt;org.eclipse.jdt.core.javabuilder&lt;/name&gt;
      &lt;/buildCommand&gt;
      &lt;/buildSpec&gt;
    &lt;natures&gt;
     &lt;nature&gt;org.eclipse.jdt.core.javanature&lt;/nature&gt;
    &lt;/natures&gt;
  &lt;/projectDescription&gt;
  </code></pre>