I have a Java EE project. The project is built using maven into an .ear archive. There is a library jar containing a JPA 2 persistence unit, which is located in the library
This article has a great table explaining things:
Table 2 A standard archive may load classes either packaged inside it or from any other archives it is dependent on.
Module Code Sources
EAR
All JARs in the /lib directory of the EAR
Manifest Class-Path of any JARs in 1
EJB-JAR
EJB-JAR file itself
JARs referenced by manifest Class-Path of EJB-JAR
JARs referenced by manifest Class-Path of above JARs (in 2)
WAR
WEB-INF/classes
JARs in WEB-INF/lib
JARs referenced by manifest Class-Path of WAR
JARs referenced by manifest Class-Path of JARs in 2 and 3