Yes, that's correct.  I have my production persistence.xml in
src/main/resources/META-INF that will use Oracle, but for integration
testing I want to use HSQLDB, so I have a persistence.xml in
src/test/resources/META-INF to *override* the main resource.  When I compile
I definitely see two distinct persistence.xml's and the one I want to use
for testing resides in target/test-classes as I would expect.  However, this
one is not being used and instead the Oracle based one is being used that's
in target/classes.

I'm completely baffled by this because when I review the manifest for the
jar that is created it shows test-classes as first (rightly so):

Manifest-Version: 1.0
Class-Path:
file:/C:/Documents%20and%20Settings/lsacco/.m2/repository/org/apache/maven/surefire/surefire-booter/2.4.3/surefire-booter-2.4.3.jar
file:/C:/Documents%20and%20Settings/lsacco/.m2/repository/org/apache/maven/surefire/surefire-api/2.4.3/surefire-api-2.4.3.jar
file:/C:/eclipse_workspaces/europa3/PCNRequestApprovalWeb/target/test-classes/
file:/C:/eclipse_workspaces/europa3/PCNRequestApprovalWeb/target/classes/ 

classPathUrl.1=C\:\\eclipse_workspaces\\europa3\\PCNRequestApprovalWeb\\target\\classes
classPathUrl.0=C\:\\eclipse_workspaces\\europa3\\PCNRequestApprovalWeb\\target\\test-classes

Mucking around with forkMode=never or useSystemClassOnly=false|true or the
manifest-jar=false (which I can't use because my cmdline args > 8092),
results in none of my tests working (even the non-db integration ones), so
the best bet is the settings in the previous post.  As I said previously, I
can exclude the persistence.xml from the main resources and then all tests
run, but obviously the resulting build artifact will be unusable.

-Lou




Baptiste MATHUS-4 wrote:
> 
> Why do you speak about "precedence"? Do you have many persistence.xml
> files?
> When you just do "compiler:*testCompile", what do you have in your target
> subdirs?* Do you see persistence.xml file?
> 
> If the resources seems to be present in those dirs, then also try using
> forkMode=never to see if that could be a problem of classloading.
> 
> My 2 cents...
> Cheers.
> 
> -- 
> Baptiste <Batmat> MATHUS - http://batmat.net
> Sauvez un arbre,
> Mangez un castor !
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Surefire-2.4.3-Classloading-issue-tp20330022p20348813.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to