compile dependencies not used in tests
--------------------------------------

                 Key: MECLIPSE-171
                 URL: http://jira.codehaus.org/browse/MECLIPSE-171
             Project: Maven 2.x Eclipse Plugin
          Issue Type: Bug
          Components: dependency resolution
    Affects Versions: 2.3
         Environment: Win XP, Eclipse 3.2.1
            Reporter: Andre Ranvik
             Fix For: 2.3


I had dependencies to other components setup in "compile" scope in the pom 
file. I created a test (under src/test/java), which used some of these 
dependencies. All well so far.
Now I added a method to a class, which was part of one of the modules I had a 
compile dependency on. I then called this method from my test. No problems 
within Eclipse finding the new method, since I was using project references. 
This means that Eclipse did not complain about the new method at compile time. 
BUT - when I ran the test, it gives me a "NoSuchMethodException" on the newly 
added method.
When I run the test from command line (mvn test), then it runs fine, without 
any problems.

I was able to resolve the problem by changing all dependencies to "test" scope 
(instead of "compile"). Everything worked fine then. I tried to change it back 
to compile, and now that worked too...!
I then tried adding another method in the same class that caused the problem - 
in order to see if there was a pattern here, but that worked too, meaning I did 
not have to change the dependencies to "test" to get Eclipse to find the new 
method call.


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

        

Reply via email to