Results 1 to 1 of 1
- 01-22-2013, 01:30 PM #1
Member
- Join Date
- Jan 2013
- Location
- London, UK
- Posts
- 1
- Rep Power
- 0
JUnit and multi-module Maven project with JPA
Hi there,
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
Similar Threads
-
Maven Project Structure
By jackett_dad in forum Apache MavenReplies: 1Last Post: 12-28-2012, 04:45 AM -
Maven 2 to Maven 3 up-gradation: Issue on version attribute
By arfeen.java in forum Apache MavenReplies: 0Last Post: 12-17-2012, 01:32 PM -
Error with a JUnit test using maven surefire plugin
By masijade in forum Apache MavenReplies: 0Last Post: 03-16-2012, 02:38 PM -
How to convert from Ant project to maven project?
By jiapei100 in forum New To JavaReplies: 0Last Post: 06-08-2011, 10:01 AM -
JUnit - Test class not found in selected project
By cka in forum New To JavaReplies: 11Last Post: 07-27-2010, 04:08 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks