title: Where to put persistence.xml in library jar using maven?
body: <p>At work we have an entity library which is used by several clients for the library (several servlets, a desktop application, etc.). The entity library consists of JPA-Annotated classes and most prominently a persistence.xml.</p>
  
  <p>All projects are configured using maven.</p>
  
  <p>Where should a persistence.xml file be put? It needs to be located inside the jar file of that entity library and I'm not sure how to configure this using maven.</p>
  
  <p>(We are just splitting up a project into several smaller projects)</p>
  
  <p>'''UPDATE''' To be clear about this, there is one Maven-Project A containing the persistence.xml and another one (B) which depends on that Project. I've places persistence.xml in src/main/resources/META-INF/persistence.xml in A, when trying to use an EntityManager inside A, no problem, insidie B: nothing works.</p>
  
  <p>EclipseLink gives the following Warning:</p>
  
  <pre><code>[EL Warning]: The collection of metamodel types is empty. Model classes may not have been found during entity search for Java SE and some Java EE container managed persistence units.  Please verify that your entity classes are referenced in persistence.xml using either &lt;class&gt; elements or a global &lt;exclude-unlisted-classes&gt;false&lt;/exclude-unlisted-classes&gt; element
  </code></pre>
  
  <p>I suspect the persistence.xml is not found, but it is present in the target jar.</p>