[ http://jira.codehaus.org/browse/MNG-422?page=all ]
     
Brett Porter closed MNG-422:
----------------------------

    Resolution: Won't Fix

When I say "Won't Fix", I mean "Will Fix, but differently". We have another 
issue to make dependency mediation better.

What is happening here is that one of your dependencies has a compile time 
dependency on junit 3.7. Compile time wins over test time (Which it should, but 
the version it uses shouldn't).

You can workaround this by changing the scope of your junit dep to "compile" 
for now.

If you can identify the POM with the compile time dependency, we can make the 
necessary changes in the repository if they are correct (it may actually have a 
compile time dep though...)

> Certain dependency graph causes tests to not compile
> ----------------------------------------------------
>
>          Key: MNG-422
>          URL: http://jira.codehaus.org/browse/MNG-422
>      Project: Maven 2
>         Type: Bug
>     Versions: 2.0-alpha-2
>  Environment: Windows XP, Cygwin
>     Reporter: Mark Hobson
>  Attachments: test.zip
>
>
> The attached projects set up the following rough dependency hierarchy:
>   testproject
>   +- testdep
>   |  +- testdep2
>   |  +- testdep3
>   |  |  +- ...
>   |  |  +- testdep4
>   |  |     +- ...
>   |  +- commons-logging
>   |  +- commons-pool
>   +- junit
> Not all dependencies are shown for the sake of brevity, but are obviously 
> available in the attached poms.
> Now unfortuantely every dependency supplied is required to reproduce this bug 
> - take one out and it works.  What happens is as follows:
> * testdep4: m2 install - ok
> * testdep3: m2 install - ok
> * testdep2: m2 install - ok
> * testdep: m2 install - ok
> * testproject: m2 install - error:
> [INFO] 
> ----------------------------------------------------------------------------
> [INFO] Building testgroup:testproject:jar:1.0-SNAPSHOT
> [INFO] 
> ----------------------------------------------------------------------------
> [INFO] maven-jar-plugin: resolved to version 2.0-alpha-2 from local repository
> [INFO] maven-resources-plugin: resolved to version 2.0-alpha-2 from local 
> repository
> [INFO] maven-compiler-plugin: resolved to version 2.0-alpha-2 from local 
> repository
> [INFO] maven-surefire-plugin: resolved to version 2.0-alpha-2 from local 
> repository
> [INFO] maven-install-plugin: resolved to version 2.0-alpha-2 from local 
> repository
> [INFO] [resources:resources]
> [INFO] testdep: using locally installed snapshot
> [INFO] testdep2: using locally installed snapshot
> [INFO] [compiler:compile]
> [INFO] No sources to compile
> [INFO] [resources:testResources]
> [INFO] [compiler:testCompile]
> Compiling 1 source file to c:\Documents and 
> Settings\mark\Desktop\testproject\target\test-classes
> [INFO] 
> ----------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO] 
> ----------------------------------------------------------------------------
> [INFO] Reason: Compilation failure
> [INFO] 
> ----------------------------------------------------------------------------
> [INFO] c:\Documents and 
> Settings\mark\Desktop\testproject\src\test\java\Test.java:[3,-1]  cannot find 
> symbol
> [INFO] 
> ----------------------------------------------------------------------------
> [INFO] Total time: 2 seconds
> [INFO] Finished at: Sun May 22 11:56:08 BST 2005
> [INFO] Final Memory: 2M/12M
> [INFO] 
> ----------------------------------------------------------------------------
> So it looks like the classpath is getting mangled somewhere since javac can't 
> find junit.  Now if Java5 is turned off in testproject, the following occurs:
> [INFO] 
> ----------------------------------------------------------------------------
> [INFO] Building testgroup:testproject:jar:1.0-SNAPSHOT
> [INFO] 
> ----------------------------------------------------------------------------
> [INFO] maven-jar-plugin: resolved to version 2.0-alpha-2 from local repository
> [INFO] maven-resources-plugin: resolved to version 2.0-alpha-2 from local 
> repository
> [INFO] maven-compiler-plugin: resolved to version 2.0-alpha-2 from local 
> repository
> [INFO] maven-surefire-plugin: resolved to version 2.0-alpha-2 from local 
> repository
> [INFO] maven-install-plugin: resolved to version 2.0-alpha-2 from local 
> repository
> [INFO] [resources:resources]
> [INFO] testdep: using locally installed snapshot
> [INFO] testdep2: using locally installed snapshot
> [INFO] [compiler:compile]
> [INFO] No sources to compile
> [INFO] [resources:testResources]
> [INFO] [compiler:testCompile]
> Compiling 1 source file to c:\Documents and 
> Settings\mark\Desktop\testproject\target\test-classes
> [INFO] 
> ----------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO] 
> ----------------------------------------------------------------------------
> [INFO] Reason: Compilation failure
> [INFO] 
> ----------------------------------------------------------------------------
> [INFO] c:\Documents and 
> Settings\mark\Desktop\testproject\src\test\java\Test.java:[3,7]  
> TestCase(java.lang.String) in j
> unit.framework.TestCase cannot be applied to ()
> [INFO] 
> ----------------------------------------------------------------------------
> [INFO] Total time: 2 seconds
> [INFO] Finished at: Sun May 22 11:56:19 BST 2005
> [INFO] Final Memory: 2M/12M
> [INFO] 
> ----------------------------------------------------------------------------
> Which could be more telling.  I seem to remember a similar error in a 
> completely different project when working with DOM Test Suites 
> (http://www.w3.org/DOM/Test/), since their DOM test jars actually contain a 
> modified version of junit which a different API.  So I'm not sure if 
> somewhere down the dependency graph a DOM test jar is being included which is 
> overriding the normal junit one?  A long shot, but thought worth mentioning.
> I haven't spent more time bringing all the external dependencies into local 
> test dependencies, since I figure you guys would be able to dump the 
> dependency graph out quicker.
> Any ideas welcome!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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

Reply via email to