I have two persistence.xml
files, for the sake of testing:
src/main/resources/META-INF/persistence.xml
src/test/resources/
I have been testing these and other similar solutions without involving the pom.xml... In my opinion, the best way to solve this issue is to have two application-context.xml (one only to be used in test classes) and to add a custom persistence unit manager bean in the test's application-context.xml. Like this example:
classpath*:META-INF/test.persistence.xml
This solution runs. :)