I run into this obstacle when my debugger steps into some classfile without corresponding source. Finding it is often difficult:
You have to search for the site hosting the respective project, and find its ``download source'' page (for instance, last time I searched for the JPA API, and it took me hours to obtain the sources). Or, you might be required to check it out from revision control.
You need to know the exact version you are using. Otherwise the debugger might step into comments and empty lines :)
There is no convention for packaging source code—some projects include it in the jar itself; some provide a separate zip file; others put it in a
src/
subfolder within the zip.
I know Maven has the capability of downloading source from its repository and including it in the src paths when an IDE config file is generated. But Maven's repo is so poor in terms of content—few libs actually have their source uploaded.
Why is it so complicated when it can be made straightforward? We could have some central repo which relates a classfile (or a hash thereof) to the source file it was compiled from (or a link to it). Maybe a rather huge repo, but pretty simply structured. An IDE plugin could query it to fetch what's needed automatically.
Have you, guys, experienced the same?
How do you obtain the sources to attach?