maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Randall Fidler" <randall.fid...@testadvantage.com>
Subject Surefire classpath issues
Date Wed, 20 Jun 2007 14:58:32 GMT
Hello,

 

            Have an issue with trying to leverage Blowfish which ships
with Java 1.5 in relation to unit tests.  The test which I'm trying to
run is using JAXB and Blowfish impl which comes with Java 1.5, i.e.
what's in SunJCE.jar (jre/lib/ext).    

 

Before I was using a different impl of Blowfish, third party jar
(cryptix) and that was setup as a dependency in my pom so JAXB and the
blowfish impl were on the same "level" - no problems.  The fun begins
when I switch from the third party jar and try to use the java provided
impl.  Now, I can use JAXB and the Java impl together fine, say, when I
run the actual application which is being tested - problems only happen
when running the unit tests via Maven.

 

First problem:

 

java.lang.NoClassDefFoundError: com/sun/crypto/provider/SunJCE

            Resolved this by enabling the childDelegation for the
surefire plugin.

 

                <groupId>org.apache.maven.plugins</groupId>

                <artifactId>maven-surefire-plugin</artifactId>

                <configuration>

                    <forkMode>always</forkMode>

                    <childDelegation>true</childDelegation>

 

Note - The surefire plugin describes the childDelegation option as:

 

 

When false it makes tests run using the standard classloader delegation
instead of the default Maven isolated classloader. Only used when
forking (forkMode is not "none").

 

Setting it to false helps with some problems caused by conflicts between
xml parsers in the classpath and the Java 5 provider parser. Default
value is false.

 

 

 

 

 

Second problem:

            

            When I enable the childDelegation, the plugin then cannot
find the JAXB classes (setup as dependencies in the pom).  I've tried
test/compile scopes on the dependencies but to no avail.

 

Note: I tried the <useSystemClassLoader>true</useSystemClassLoader>
option, but that only seemed to make things worse.

 

 

 

 

Any help is greatly appreciated!

 

Regards,

 

Randall


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message