You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Jason Dillon <ja...@planet57.com> on 2007/02/01 06:51:45 UTC

maven.repo.local needs to be absolute or canonical (was Re: server/branches/1.2 build failing due to surefire not finding junit?!)

Aight, I think I understand why this happens...

When I was building locally and on remote systems, I was using - 
Dmaven.repo.local=repository to use a specific repository directoy.   
But it looks like something inside of Maven or Surefire is not happy  
if this value is not absolute or canonical.  While most of Maven is  
happy with the relative path downloading a ton of artifacts into the  
correct directory, something gets screwy when going to launch tests.

I've fixed my harness to make this path canonical, but my guess is  
that Maven should always resolve maven.repo.local to a canonical file  
before attempting to use it for sanity.

Any Maven peeps out there know if this is a known issue?

--jason


On Jan 31, 2007, at 9:05 PM, Dain Sundstrom wrote:

> I've seen this error before in the OpenEJB build, but it always  
> went away with a full build and it was in a module with no tests.   
> It's just wacky.
>
> -dain
>
> On Jan 31, 2007, at 8:51 PM, Jason Dillon wrote:
>
>> Anyone know whats going on?  The build is failing because the  
>> surefire plugin is unable to find junit classes:
>>
>>     java.lang.NoClassDefFoundError: junit/framework/TestCase
>>
>> WTF?  This is relatively new behavior... something has changed in  
>> the past day or so which is causing this... but I've no idea what  
>> it is.
>>
>> Anyone have any clue?
>>
>> The snip below is from a build I did today of server/branches/1.2  
>> (rev 502120, no local changes) with a clean repo.  I checked to  
>> make sure that the junit jars were valid too and the jar looked  
>> fine.  I see the exact same problem on my local machine as well on  
>> remote gbuild hosts.
>>
>> <snip>
>> ...
>> [INFO]  
>> --------------------------------------------------------------------- 
>> -------
>> [INFO] Building Geronimo :: Activation
>> [INFO]    task-segment: [install]
>> [INFO]  
>> --------------------------------------------------------------------- 
>> -------
>> [INFO] [tools:require-java-version {execution: validate-java- 
>> version}]
>> [INFO] [tools:copy-legal-files {execution: install-legal-files}]
>> [INFO] [resources:resources]
>> [INFO] Using default encoding to copy filtered resources.
>> Downloading: http://people.apache.org/repo/m2-snapshot-repository/ 
>> org/apache/geronimo/specs/geronimo-activation_1.0.2_spec/1.2/ 
>> geronimo-activation_1.0.2_spec-1.2.pom
>> [WARNING] Unable to get resource  
>> 'org.apache.geronimo.specs:geronimo-activation_1.0.2_spec:pom:1.2'  
>> from repository apache-snapshots (http://people.apache.org/repo/m2- 
>> snapshot-repository)
>> Downloading: http://people.apache.org/repo/m2-incubating- 
>> repository//org/apache/geronimo/specs/geronimo- 
>> activation_1.0.2_spec/1.2/geronimo-activation_1.0.2_spec-1.2.pom
>> [WARNING] Unable to get resource  
>> 'org.apache.geronimo.specs:geronimo-activation_1.0.2_spec:pom:1.2'  
>> from repository apache-incubator (http://people.apache.org/repo/m2- 
>> incubating-repository/)
>> Downloading: http://repository.codehaus.org/org/apache/geronimo/ 
>> specs/geronimo-activation_1.0.2_spec/1.2/geronimo- 
>> activation_1.0.2_spec-1.2.pom
>> [WARNING] Unable to get resource  
>> 'org.apache.geronimo.specs:geronimo-activation_1.0.2_spec:pom:1.2'  
>> from repository codehaus (http://repository.codehaus.org)
>> Downloading: http://repo1.maven.org/maven2/org/apache/geronimo/ 
>> specs/geronimo-activation_1.0.2_spec/1.2/geronimo- 
>> activation_1.0.2_spec-1.2.pom
>> 817b downloaded
>> Downloading: http://people.apache.org/repo/m2-snapshot-repository/ 
>> org/apache/geronimo/specs/geronimo-javamail_1.3.1_spec/1.2/ 
>> geronimo-javamail_1.3.1_spec-1.2.pom
>> [WARNING] Unable to get resource  
>> 'org.apache.geronimo.specs:geronimo-javamail_1.3.1_spec:pom:1.2'  
>> from repository apache-snapshots (http://people.apache.org/repo/m2- 
>> snapshot-repository)
>> Downloading: http://people.apache.org/repo/m2-incubating- 
>> repository//org/apache/geronimo/specs/geronimo-javamail_1.3.1_spec/ 
>> 1.2/geronimo-javamail_1.3.1_spec-1.2.pom
>> [WARNING] Unable to get resource  
>> 'org.apache.geronimo.specs:geronimo-javamail_1.3.1_spec:pom:1.2'  
>> from repository apache-incubator (http://people.apache.org/repo/m2- 
>> incubating-repository/)
>> Downloading: http://repository.codehaus.org/org/apache/geronimo/ 
>> specs/geronimo-javamail_1.3.1_spec/1.2/geronimo- 
>> javamail_1.3.1_spec-1.2.pom
>> [WARNING] Unable to get resource  
>> 'org.apache.geronimo.specs:geronimo-javamail_1.3.1_spec:pom:1.2'  
>> from repository codehaus (http://repository.codehaus.org)
>> Downloading: http://repo1.maven.org/maven2/org/apache/geronimo/ 
>> specs/geronimo-javamail_1.3.1_spec/1.2/geronimo- 
>> javamail_1.3.1_spec-1.2.pom
>> 1K downloaded
>> Downloading: http://people.apache.org/repo/m2-snapshot-repository/ 
>> org/apache/geronimo/specs/geronimo-activation_1.0.2_spec/1.2/ 
>> geronimo-activation_1.0.2_spec-1.2.jar
>> [WARNING] Unable to get resource  
>> 'org.apache.geronimo.specs:geronimo-activation_1.0.2_spec:jar:1.2'  
>> from repository apache-snapshots (http://people.apache.org/repo/m2- 
>> snapshot-repository)
>> Downloading: http://people.apache.org/repo/m2-incubating- 
>> repository//org/apache/geronimo/specs/geronimo- 
>> activation_1.0.2_spec/1.2/geronimo-activation_1.0.2_spec-1.2.jar
>> [WARNING] Unable to get resource  
>> 'org.apache.geronimo.specs:geronimo-activation_1.0.2_spec:jar:1.2'  
>> from repository apache-incubator (http://people.apache.org/repo/m2- 
>> incubating-repository/)
>> Downloading: http://repository.codehaus.org/org/apache/geronimo/ 
>> specs/geronimo-activation_1.0.2_spec/1.2/geronimo- 
>> activation_1.0.2_spec-1.2.jar
>> [WARNING] Unable to get resource  
>> 'org.apache.geronimo.specs:geronimo-activation_1.0.2_spec:jar:1.2'  
>> from repository codehaus (http://repository.codehaus.org)
>> Downloading: http://repo1.maven.org/maven2/org/apache/geronimo/ 
>> specs/geronimo-activation_1.0.2_spec/1.2/geronimo- 
>> activation_1.0.2_spec-1.2.jar
>> 33K downloaded
>> Downloading: http://people.apache.org/repo/m2-snapshot-repository/ 
>> org/apache/geronimo/specs/geronimo-javamail_1.3.1_spec/1.2/ 
>> geronimo-javamail_1.3.1_spec-1.2.jar
>> [WARNING] Unable to get resource  
>> 'org.apache.geronimo.specs:geronimo-javamail_1.3.1_spec:jar:1.2'  
>> from repository apache-snapshots (http://people.apache.org/repo/m2- 
>> snapshot-repository)
>> Downloading: http://people.apache.org/repo/m2-incubating- 
>> repository//org/apache/geronimo/specs/geronimo-javamail_1.3.1_spec/ 
>> 1.2/geronimo-javamail_1.3.1_spec-1.2.jar
>> [WARNING] Unable to get resource  
>> 'org.apache.geronimo.specs:geronimo-javamail_1.3.1_spec:jar:1.2'  
>> from repository apache-incubator (http://people.apache.org/repo/m2- 
>> incubating-repository/)
>> Downloading: http://repository.codehaus.org/org/apache/geronimo/ 
>> specs/geronimo-javamail_1.3.1_spec/1.2/geronimo- 
>> javamail_1.3.1_spec-1.2.jar
>> [WARNING] Unable to get resource  
>> 'org.apache.geronimo.specs:geronimo-javamail_1.3.1_spec:jar:1.2'  
>> from repository codehaus (http://repository.codehaus.org)
>> Downloading: http://repo1.maven.org/maven2/org/apache/geronimo/ 
>> specs/geronimo-javamail_1.3.1_spec/1.2/geronimo- 
>> javamail_1.3.1_spec-1.2.jar
>> 178K downloaded
>> [INFO] [compiler:compile]
>> [INFO] Nothing to compile - all classes are up to date
>> [INFO] [resources:testResources]
>> [INFO] Using default encoding to copy filtered resources.
>> [INFO] [compiler:testCompile]
>> [INFO] Nothing to compile - all classes are up to date
>> [INFO] [surefire:test]
>> Downloading: http://repository.codehaus.org/org/codehaus/plexus/ 
>> plexus-utils/1.1/plexus-utils-1.1.jar
>> [WARNING] Unable to get resource 'org.codehaus.plexus:plexus- 
>> utils:jar:1.1' from repository codehaus (http:// 
>> repository.codehaus.org)
>> Downloading: http://repo1.maven.org/maven2/org/codehaus/plexus/ 
>> plexus-utils/1.1/plexus-utils-1.1.jar
>> 164K downloaded
>> Downloading: http://repository.codehaus.org/org/apache/maven/ 
>> surefire/surefire-junit/2.0/surefire-junit-2.0.pom
>> [WARNING] Unable to get resource  
>> 'org.apache.maven.surefire:surefire-junit:pom:2.0' from repository  
>> codehaus (http://repository.codehaus.org)
>> Downloading: http://repo1.maven.org/maven2/org/apache/maven/ 
>> surefire/surefire-junit/2.0/surefire-junit-2.0.pom
>> 583b downloaded
>> Downloading: http://repository.codehaus.org/org/apache/maven/ 
>> surefire/surefire-providers/2.0/surefire-providers-2.0.pom
>> [WARNING] Unable to get resource  
>> 'org.apache.maven.surefire:surefire-providers:pom:2.0' from  
>> repository codehaus (http://repository.codehaus.org)
>> Downloading: http://repo1.maven.org/maven2/org/apache/maven/ 
>> surefire/surefire-providers/2.0/surefire-providers-2.0.pom
>> 1K downloaded
>> Downloading: http://repository.codehaus.org/org/apache/maven/ 
>> surefire/surefire-junit/2.0/surefire-junit-2.0.jar
>> [WARNING] Unable to get resource  
>> 'org.apache.maven.surefire:surefire-junit:jar:2.0' from repository  
>> codehaus (http://repository.codehaus.org)
>> Downloading: http://repo1.maven.org/maven2/org/apache/maven/ 
>> surefire/surefire-junit/2.0/surefire-junit-2.0.jar
>> 11K downloaded
>> [INFO] Surefire report directory: /Users/jason/ws/geronimo/ 
>> server-1.2/modules/geronimo-activation/target/surefire-reports
>> 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 
>> (IsolatedClassLoader.java:100)
>>         at java.lang.ClassLoader.loadClassInternal 
>> (ClassLoader.java:319)
>>         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 
>> (IsolatedClassLoader.java:100)
>>         at java.lang.ClassLoader.loadClassInternal 
>> (ClassLoader.java:319)
>>         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 
>> (IsolatedClassLoader.java:100)
>>         at  
>> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.locateTest 
>> Sets(AbstractDirectoryTestSuite.java:84)
>>         at  
>> org.apache.maven.surefire.Surefire.createSuiteFromDefinition 
>> (Surefire.java:147)
>>         at org.apache.maven.surefire.Surefire.run(Surefire.java:108)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native  
>> Method)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke 
>> (NativeMethodAccessorImpl.java:39)
>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke 
>> (DelegatingMethodAccessorImpl.java:25)
>>         at java.lang.reflect.Method.invoke(Method.java:585)
>>         at  
>> org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess 
>> (SurefireBooter.java:225)
>>         at org.apache.maven.surefire.booter.SurefireBooter.main 
>> (SurefireBooter.java:747)
>> [INFO]  
>> --------------------------------------------------------------------- 
>> ---
>> [ERROR] BUILD FAILURE
>> [INFO]  
>> --------------------------------------------------------------------- 
>> ---
>> [INFO] There are test failures.
>> [INFO]  
>> --------------------------------------------------------------------- 
>> ---
>> </snip>
>>
>> --jason
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: maven.repo.local needs to be absolute or canonical (was Re: server/branches/1.2 build failing due to surefire not finding junit?!)

Posted by Jason Dillon <ja...@planet57.com>.
I think that the local repo needs to be make canonical when  
initialized (from settings.xml or from system property), should fix  
the bulk of strange problems which are related.

--jason


On Feb 3, 2007, at 2:32 PM, Jorg Heymans wrote:

> Jason Dillon wrote:
>
>> When I was building locally and on remote systems, I was using - 
>> Dmaven.repo.local=repository to use a specific repository  
>> directoy.  But it looks like something inside of Maven or Surefire  
>> is not happy if this value is not absolute or canonical.  While  
>> most of Maven is happy with the relative path downloading a ton of  
>> artifacts into the correct directory, something gets screwy when  
>> going to launch tests.
>> I've fixed my harness to make this path canonical, but my guess is  
>> that Maven should always resolve maven.repo.local to a canonical  
>> file before attempting to use it for sanity.
>> Any Maven peeps out there know if this is a known issue?
>
> FWIW i can confirm this, had the same problem when building Cocoon  
> with a relative repository set in settings.xml.
>
>
> Jorg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: maven.repo.local needs to be absolute or canonical (was Re: server/branches/1.2 build failing due to surefire not finding junit?!)

Posted by Jorg Heymans <jh...@apache.org>.
Jason Dillon wrote:

> When I was building locally and on remote systems, I was using 
> -Dmaven.repo.local=repository to use a specific repository directoy.  
> But it looks like something inside of Maven or Surefire is not happy if 
> this value is not absolute or canonical.  While most of Maven is happy 
> with the relative path downloading a ton of artifacts into the correct 
> directory, something gets screwy when going to launch tests.
> 
> I've fixed my harness to make this path canonical, but my guess is that 
> Maven should always resolve maven.repo.local to a canonical file before 
> attempting to use it for sanity.
> 
> Any Maven peeps out there know if this is a known issue?

FWIW i can confirm this, had the same problem when building Cocoon with 
a relative repository set in settings.xml.


Jorg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org