title: Eclipse Warnings: class javax.persistence.* not found
body: <p>This is my first time really playing around with Java development using Eclipse. I am trying to use EclipseLink's implementation of the JPA. I moved all of my entities into a separate package "entities". I have the <code>persistence.xml</code> in a separate JPA project called "dataModeling".</p>
  
  <p><img src="https://i.stack.imgur.com/CuCUQ.png" alt="package explorer"></p>
  
  <p>Everything builds and runs fine.</p>
  
  <p>Just about every project depends on my entities. However, I'm seeing a warning <code>Class javax.persistence.Entity not found - continuing with a stub.</code>, etc. showing up because the dependent projects don't reference EclipseLink.</p>
  
  <p><img src="https://i.stack.imgur.com/H4zwO.png" alt="warning messages"></p>
  
  <p>The solution is to go into each dependent project's properties and under <strong>Java Build Path > Libraries</strong>, click <strong>Add Library</strong>, then <strong>User Library</strong> and then select <strong>EclipseLink</strong>.</p>
  
  <p>However, to me, it doesn't make sense to reference EclipseLink in every project! That's an implementation detail I don't want to burden other projects with. It looks like this is happening because the other projects see the annotations and don't recognize them.</p>
  
  <p>So the real question is: how can I use JPA (via annotations) without every other project needing to reference my JPA implementation?</p>