Note: Package
the persistence units in separate JAR files to make them more accessible
and reusable. If you package the persistence units this way, they
can be tested outside the container both with and without the occurrence
of database persistence. The persistence units can be included in
standalone applications or they can be packaged into EAR files as
persistence archive files. If you package the persistence unit into
a persistence archive file, all of the application components must
be able to access the persistence archive. The application that uses
the persistence units must declare a dependency on the persistence
archive using the
MANIFEST.MF Class-Path: declaration.
The
Criteria Metamodel class files that are generated by the Annotation
Processor when you developed your JPA application, need to be included
in the JAR file in the same location as the entity class files.