In Eclipse, for jar-libraries you can attach an archive with source-code files to get classes from a library linked to the actual source-code and allow debugging et.al.
However I cannot get it to work when the source files are located further down in the directory structure.
E.g. Apache Commons Beanutils, the source-archive that I can download from Apache contains the following structure:
commons-beanutils-1.8.3-src
|_ src
|_org
|_apache
|_...
So if I just add the commons-beanutils-1.8.3-src.zip as source-attachment, Eclipse does not find the code because it does not know about the sub-folders.
I know that I can unpack source (and then pack it up again), but I have a number of libraries that I would like to handle and therefore I would like to take the source-archive “as is” and avoid these manual steps each time I upgrade one of those.
Is there a way to do this or does Eclipse simply not provide functionality for this?
The binary download includes a source (and doc) jar:
The source download is intended to be a source directory, not used as a source attachment.
Unlike attaching Javadocs there’s no way to set a path inside a source jar.