Off the top of my head, the only thing I could think would be if, by
redirecting the localRepo, you're running into max lengths of paths on
Windows, or maxing out the -classpath argument length.

It is certainly an odd problem, and I've never seen it myself, nor
seen it reported on this list. In fact, I know many people are using
localRepo setting to utilize a different location very successfully.
So I'd expect the problem is specific to your environment somehow.

Wayne

On 8/1/07, Vihung Marathe <[EMAIL PROTECTED]> wrote:
> When running maven with a non standard location for the local
> repository, it seems that maven cannot find the JUnit classes.
>
> As soon as I use the default repository location, everything works
> fine.
>
> The contents of both local repositories are identical. I have ensured
> this by deleting and copying from one to the other (both ways) and
> also by deleting and getting a forcing a fresh set of dependencies -
> once from repo1 and once from ibiblio.
>
> I am using Maven 2.0.7 with JDK 1.5.0_12 on Windows XP, primarily
>
> mvn -version results in
>    Maven version: 2.0.7
>    Java version: 1.5.0_12
>    OS name: "windows xp" version: "5.1" arch: "x86"
>
> But it happens regardless of which version of JUnit I use (I have used
> 3.8.1 and 4.3), and regardless of which JDK I use (I have used both
> 1.4.2 and 1.5.0).
>
> It happens on my colleague's Windows 2000 machine as well
>
> The only factor that affects it is whether I am using a custom
> repository location or the default one.
>
> I set the repository location by putting
>    <localRepository>support\build\repository</localRepository>
> in my settings.xml
>
> With that line in the settings.xml, I can reproduce the error every
> time with
>    mvn clean test
>
> Every time that line is commented out, the error does not occur.
>
> I have looked at the resulting forked command, and the only difference
> I can see is the location of the JARs. Nothing else.
>
> Any ideas what is causing this?
>
> The exception and stack trace is
>
> org.apache.maven.surefire.booter.SurefireExecutionException:
> junit/framework/TestCase; nested exception is
> java.lang.NoClassDefFoundError: junit/framework/TestCase
> java.lang.NoClassDefFoundError: junit/framework/TestCase
>        at java.lang.ClassLoader.defineClass1(Native Method)
>        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
>        at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124
> )
>        at
> java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
>        at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
>        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>        at
> org.apache.maven.surefire.booter.IsolatedClassLoader.loadClass(Isolate
> dClassLoader.java:103)
>        at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.locateTestS
> ets(AbstractDirectoryTestSuite.java:87)
>        at
> org.apache.maven.surefire.Surefire.createSuiteFromDefinition(Surefire.
> java:150)
>        at org.apache.maven.surefire.Surefire.run(Surefire.java:111)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
> ava:39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> orImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:585)
>        at
> org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(Sur
> efireBooter.java:290)
>        at
> org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.ja
> va:818)
>
>
>
> With mvn -X , I get
>
> ... snip ...
> [INFO] Surefire report directory:
> D:\workspace\OfflineServices\offline-client\target\surefire-reports
> Forking command line:
> D:\workspace\OfflineServices\support\build\jdk1.5.0_12\jre\bin\java
> -classpath
> D:\workspace\OfflineServices\support\build\repository\org\codehaus\ple
> xus\plexus-archiver\1.0-alpha-7\plexus-archiver-1.0-alpha-7.jar;D:\wor
> kspace\OfflineServices\support\build\repository\junit\junit\3.8.1\juni
> t-3.8.1.jar;D:\workspace\OfflineServices\support\build\repository\org\
> apache\maven\surefire\surefire-api\2.3\surefire-api-2.3.jar;D:\workspa
> ce\OfflineServices\support\build\repository\org\codehaus\plexus\plexus
> -container-default\1.0-alpha-8\plexus-container-default-1.0-alpha-8.ja
> r;D:\workspace\OfflineServices\support\build\repository\classworlds\cl
> assworlds\1.1-alpha-2\classworlds-1.1-alpha-2.jar;D:\workspace\Offline
> Services\support\build\repository\org\codehaus\plexus\plexus-utils\1.1
> \plexus-utils-1.1.jar;D:\workspace\OfflineServices\support\build\repos
> itory\commons-lang\commons-lang\2.1\commons-lang-2.1.jar;D:\workspace\
> OfflineServices\support\build\repository\org\apache\maven\surefire\sur
> efire-booter\2.3\surefire-booter-2.3.jar
> org.apache.maven.surefire.booter.SurefireBooter
> C:\DOCUME~1\MARATV1\LOCALS~1\Temp\surefire55254tmp
> C:\DOCUME~1\MARATV1\LOCALS~1\Temp\surefire55255tmp
> org.apache.maven.surefire.booter.SurefireExecutionException:
> junit/framework/TestCase; nested exception is
> java.lang.NoClassDefFoundError: junit/framework/TestCase
> java.lang.NoClassDefFoundError: junit/framework/TestCase
>        at java.lang.ClassLoader.defineClass1(Native Method)
>        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
>        at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124
> )
>        at
> java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
>        at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
>        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>        at
> org.apache.maven.surefire.booter.IsolatedClassLoader.loadClass(Isolate
> dClassLoader.java:103)
>        at
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.locateTestS
> ets(AbstractDirectoryTestSuite.java:87)
>        at
> org.apache.maven.surefire.Surefire.createSuiteFromDefinition(Surefire.
> java:150)
>        at org.apache.maven.surefire.Surefire.run(Surefire.java:111)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
> ava:39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> orImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:585)
>        at
> org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(Sur
> efireBooter.java:290)
>        at
> org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.ja
> va:818)
> [INFO]
> ----------------------------------------------------------------------
> --
> [ERROR] BUILD FAILURE
> [INFO]
> ----------------------------------------------------------------------
> --
> [INFO] There are test failures.
> [INFO]
> ----------------------------------------------------------------------
> --
> [DEBUG] Trace
> org.apache.maven.BuildFailureException: There are test failures.
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defau
> ltLifecycleExecutor.java:560)
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLif
> ecycle(DefaultLifecycleExecutor.java:480)
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defaul
> tLifecycleExecutor.java:459)
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHand
> leFailures(DefaultLifecycleExecutor.java:311)
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegment
> s(DefaultLifecycleExecutor.java:278)
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLif
> ecycleExecutor.java:143)
>        at
> org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
>        at
> org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
>        at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
> ava:39)
>        at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> orImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:585)
>        at
> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>        at
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.MojoFailureException: There are
> test failures.
>        at
> org.apache.maven.plugin.surefire.SurefirePlugin.execute(SurefirePlugin
> .java:425)
>        at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugin
> Manager.java:443)
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defau
> ltLifecycleExecutor.java:539)
>        ... 16 more
> ... snip ...
>
> _________________________________________________________________

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

Reply via email to