How to instruct Maven to ignore my main/resources/persistence.xml in favor of test/...?

Viewed 10015

I have two persistence.xml files, for the sake of testing:

  • src/main/resources/META-INF/persistence.xml
  • src/test/resources/META-INF/persistence.xml

How to instruct Maven to ignore the first file during testing? Now it is not ignored since OpenEJB says:

ERROR - FAIL ... Finder: @PersistenceContext unitName has multiple matches: 
unitName "abc" has 2 possible matches.
4 Answers
Related