You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Ken DeLong (JIRA)" <ji...@codehaus.org> on 2006/10/27 20:06:04 UTC

[jira] Created: (MNGECLIPSE-206) Classpath not resolved correctly in Eclipse JUnit Test Runner

Classpath not resolved correctly in Eclipse JUnit Test Runner
-------------------------------------------------------------

                 Key: MNGECLIPSE-206
                 URL: http://jira.codehaus.org/browse/MNGECLIPSE-206
             Project: Maven 2.x Extension for Eclipse
          Issue Type: Bug
          Components: Dependency Resolver
    Affects Versions: 0.0.9
         Environment: Eclipse 3.2.1
JDK 1.5.0_05
Windows XP
MyEclipse 5.0.1
Subclipse 1.1.8
            Reporter: Ken DeLong


Maven2 Dependencies are not resolved in the Eclise JUnit testrunner when cross-project references are present.  Similar to MNGECLIPSE-114.

I see this behavior: I have Maven2 Dependencies on the project A classpath, which includes spring-mock.jar.  I have JUnit tests that decend from test superclasses in spring-mock.jar in project A.  My project A depends on another project open in Eclipse, call it project B.  Project B is above Maven2 Dependencies in Eclipse's "Order and Export" dialog.

When I run my unit tests in Eclipse with the Run As -> JUnit test, it cannot find the spring-mock.jar.  The launch configuration shows the Project A classpath, including Maven2 Dependencies, but those jars are not being resolved.

Workaround 1: We can edit the launch configuration to add Maven2 Dependencies to the bootstrap classpath for the test.  But this has to be done by each developer for each test case, since launch configs are not shared.  This is unworkable.

Workaround 2: Based on MNGECLIPSE-114, I ran Maven 2 -> Update Source Folders.  Then my test worked!  However, when I examined the classpath, it had removed the reference to Project B (the binary dependency to projectB-SNAPSHOT.jar is listed in the POM and included in Maven2 Dependencies).  So going to binary-only dependencies seems to fix the problem.

HOWEVER, this is suboptimal for us.  We are starting a new project and have several modules under simultaneous development.  A lot of refactoring is occurring, and if we add the projects to the classpath Eclipse will propagate refactorings across projects, which is a HUGE efficiency gain for us.  Otherwise, we do a refactoring, run Maven, make note of all the broken code, and go hunt it down by hand.  Very annoying.  Also, we are also just working in two modules at once (for example, domain model and db service) and having to run a full maven build after each little change to have the IDE pick it up is horrible.

So we really need to have the Maven2 Dependencies resolved correctly for the Eclipse JUnit test runner even in the presence of cross-project references in the Eclipse classpath.

Thanks!!

-- 
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

        

[jira] Closed: (MNGECLIPSE-206) Classpath not resolved correctly in Eclipse JUnit Test Runner

Posted by "Eugene Kuleshov (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNGECLIPSE-206?page=all ]

Eugene Kuleshov closed MNGECLIPSE-206.
--------------------------------------

    Resolution: Duplicate

This should be resolved by MNGECLIPSE-59

> Classpath not resolved correctly in Eclipse JUnit Test Runner
> -------------------------------------------------------------
>
>                 Key: MNGECLIPSE-206
>                 URL: http://jira.codehaus.org/browse/MNGECLIPSE-206
>             Project: Maven 2.x Extension for Eclipse
>          Issue Type: Bug
>          Components: Dependency Resolver
>    Affects Versions: 0.0.9
>         Environment: Eclipse 3.2.1
> JDK 1.5.0_05
> Windows XP
> MyEclipse 5.0.1
> Subclipse 1.1.8
>            Reporter: Ken DeLong
>
> Maven2 Dependencies are not resolved in the Eclise JUnit testrunner when cross-project references are present.  Similar to MNGECLIPSE-114.
> I see this behavior: I have Maven2 Dependencies on the project A classpath, which includes spring-mock.jar.  I have JUnit tests that decend from test superclasses in spring-mock.jar in project A.  My project A depends on another project open in Eclipse, call it project B.  Project B is above Maven2 Dependencies in Eclipse's "Order and Export" dialog.
> When I run my unit tests in Eclipse with the Run As -> JUnit test, it cannot find the spring-mock.jar.  The launch configuration shows the Project A classpath, including Maven2 Dependencies, but those jars are not being resolved.
> Workaround 1: We can edit the launch configuration to add Maven2 Dependencies to the bootstrap classpath for the test.  But this has to be done by each developer for each test case, since launch configs are not shared.  This is unworkable.
> Workaround 2: Based on MNGECLIPSE-114, I ran Maven 2 -> Update Source Folders.  Then my test worked!  However, when I examined the classpath, it had removed the reference to Project B (the binary dependency to projectB-SNAPSHOT.jar is listed in the POM and included in Maven2 Dependencies).  So going to binary-only dependencies seems to fix the problem.
> HOWEVER, this is suboptimal for us.  We are starting a new project and have several modules under simultaneous development.  A lot of refactoring is occurring, and if we add the projects to the classpath Eclipse will propagate refactorings across projects, which is a HUGE efficiency gain for us.  Otherwise, we do a refactoring, run Maven, make note of all the broken code, and go hunt it down by hand.  Very annoying.  Also, we are also just working in two modules at once (for example, domain model and db service) and having to run a full maven build after each little change to have the IDE pick it up is horrible.
> So we really need to have the Maven2 Dependencies resolved correctly for the Eclipse JUnit test runner even in the presence of cross-project references in the Eclipse classpath.
> Thanks!!

-- 
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