Results 1 to 1 of 1
- 01-22-2013, 01:30 PM #1Member
- Join Date
- Jan 2013
- London, UK
- Rep Power
JUnit and multi-module Maven project with JPA
I've got two modules in my multi-module Maven project: mod1 and mod2
mod1 is the generic JPA gateway to establish a DB connection and provide EntityManagerFactory while mod2 contains the actual DAO classes.
Now, I've got a test case in mod2 which is using mod1 to provide a JPA EntityManagerFactory.
I've got my persistence.xml in mod1 obviously as both mod1/src/main/resources/META-INF/persistence.xml and mod1/src/test/resources/META-INF/persistence.xml obviously with two different config, one for production and one for tests.
When calling my unit test in mod2 I noticed persistence.xml is used from mod1/target/classes/META-INF/persistence.xml
This is bad as I want to use the one generated in mod1/target/test-classes/META-INF/persistence.xml with my test config.
I've got all my pom's properly set up, everything's working fine just this unit test misery is strange.
Any idea how to resolve this issue?
Thank you guys
- By jackett_dad in forum Apache MavenReplies: 1Last Post: 12-28-2012, 04:45 AM
- By arfeen.java in forum Apache MavenReplies: 0Last Post: 12-17-2012, 01:32 PM
- By masijade in forum Apache MavenReplies: 0Last Post: 03-16-2012, 02:38 PM
- By jiapei100 in forum New To JavaReplies: 0Last Post: 06-08-2011, 10:01 AM
- By cka in forum New To JavaReplies: 11Last Post: 07-27-2010, 04:08 PM