I have a multi-module maven project like this:
-project
+-sub-project1
+-sub-project2
For my JUnit tests, I create another persistence.xml file inside the sub-project1/src/test/resources/META-INF. This project is a dependency for the sub-project2, in this way, I was hopping that the tests of sub-project2 use the same test persistence.xml from sub-project1, but it not happen.
So, I was wondering why I can made maven automatically copy this file to the other submodules during the test phase… maybe it’s better if I put this file in the project/resources folder, e.g., and then copy them…
I was hopping that someone already managed this to work somehow, and can help me or show how to do this.
Thanks in advance.
I managed it to work like this:
I create a
project/assembly/test/resources/META-INF/persistence.xmlfile, and add this to my pom.xml:It works gracefullt.