Source for different library versions in same project

I have a project with several modules defined. Module A depends on spring 1.2.7 and has the source attached to that library. Module B depends on spring 2.0-rc2 and also has source attached. Now when I'm debugging module B and try to trace into the spring code, the debugger is at the right line of the spring 2.0 code, but it brings up the source from the 1.2.7 version.

So my question is, how does Intellij decide which version of source to bring up? I've got module B's Order/Export tab set so that the spring 2.0 jar file is right after the module source.

Thanks!
David

3 comments
Comment actions Permalink

I think we need to know more about your modules because I don't know how your code is connected but I'll take a stab at this anyway. s there another module that you use, say 'C' that invokes either module 'A' or 'B'? I guess I would setup a module just for testing/debugging (if you don't have one already) that has the correct dependency module defined (either A or B) and IntelliJ should load the correct source. If not, it's a bug and you should report it.

0
Comment actions Permalink

Thanks for the suggestions. In my case, module B depends on module A. But I have the spring 2.0 jar file ahead of module A in the order/export tab. I wonder if this is related to another issue I've seen...which is that IDEA tends to use the libraries of dependent module in sub-module when running unit tests...even if those libraries have not been marked for export.

David

0
Comment actions Permalink

Weird...I just reloaded my project, started up the debugger and now it's using the right classpath.

It seems that flipping back and forth between debugging sessions in different modules can get IDEA into a funny state where it starts using the wrong classpath. I'll have to keep an eye on it and see if I can figure out what the circumstances are that get it into that state.

Thanks!
David

0

Please sign in to leave a comment.