Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 2.3
-
Fix Version/s: None
-
Labels:None
-
Environment:Win XP, Eclipse 3.2.1
-
Number of attachments :
Description
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.