There is one persistence.xml per persistence-unit.
META-INF/persistence.xml can be anywhere in the classpath as long as it
contains the list of persistence class names. Look at chapter #6.2 of
the JPA 1.0 spec.
Thanks,
Sahoo
Farrukh Najmi wrote:
>
> I have a base project (base-project) that produces a jar with
> persistence classes and a META-INF/persistence.xml file.
>
> Next, I want to use a standalone test program that depends upon the
> base-project.jar for persistence classes and wish to add additional
> persistence.xml files (to add entity listeners and perhaps additional
> persistence classes etc.).
>
> Does the spec require that any additional persistence.xml files be in
> a jar/war etc. or can it be anywhere in the classpath including under
> a directory in classpath?
>
> Specifically, is it legal to place it in META-INF/persistence.xml in
> any directory on the classpath and expect it to be processed by the
> Persistence provider?
>
> TIA for your help.
>