Bug 235075 - [enh] adding nested folders as source attachments to user libraries
Summary: [enh] adding nested folders as source attachments to user libraries
Status: VERIFIED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.4 RC4   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-02 04:56 EDT by Andreas Goetz CLA
Modified: 2008-06-06 09:14 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Goetz CLA 2008-06-02 04:56:16 EDT
Build ID: I20080530-1730

Steps To Reproduce:
Not sure this is a java, eclipse or user issue. Using apache poi I'd like to attach the source zip to the library jar when defining user libraries. 
However, the zip provided has a layout of poi-3.1-beta2\src which seems to defeat the source attachment mechanism.

I'm wondering if it might be possible to 
a) have the source attachment auto-search for a src folder in a resource or
b) be able to specifiy resource subfolder in addition to resource names, e.g. c:\poi-3.1-beta2.zip\src
Comment 1 Andreas Goetz CLA 2008-06-02 05:16:16 EDT
A third option, similar to b) could be to specify this as external folder rather than external zip. On Windows platform, explorer allows expanding ZIPs same as normal folders- this approach could work here, too.
Comment 2 Jerome Lanneluc CLA 2008-06-05 11:29:58 EDT
(In reply to comment #0)
> I'm wondering if it might be possible to 
> a) have the source attachment auto-search for a src folder in a resource or
We already do search for the src folder. Do you have more details on the layout of the zip?

> b) be able to specifiy resource subfolder in addition to resource names, e.g.
> c:\poi-3.1-beta2.zip\src
This is also possible. There is no UI for this though. But you can add a "rootpath" attribute to a <classpathentry> in the .classpath file. The path is however relative to the zip.

(In reply to comment #1)
> A third option, similar to b) could be to specify this as external folder
> rather than external zip. On Windows platform, explorer allows expanding ZIPs
> same as normal folders- this approach could work here, too.
External folders are also supported in 3.4. There is no UI for this either, but you can still edit the .classpath file to point the "sourcepath" attribute to an external folder.

Comment 3 Andreas Goetz CLA 2008-06-05 13:23:03 EDT
You can see the zip for yourself here.
Comment 4 Andreas Goetz CLA 2008-06-05 14:33:43 EDT
Mhm- I've updated .classpath like this:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="src" path=""/>
	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
	<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Apache POI 3.0" rootpath="poi-3.1-beta2/src"/>
	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
	<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/log4j"/>
	<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Siebel 7.8"/>
	<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Oracle 10"/>
	<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/SQLite"/>
	<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Apache Commons"/>
	<classpathentry kind="output" path="bin"/>
</classpath>

and then refreshed the project. Source is still not found though?
Comment 5 Jerome Lanneluc CLA 2008-06-06 07:07:28 EDT
(In reply to comment #3)
> You can see the zip for yourself here.
Where?

(In reply to comment #4)
It looks like I was not clear enough: you should add the "rootpath" attribute in addition to the "sourcepath" attribute, e.g.
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Apache
> POI 3.0" sourcepath="path to the source" rootpath="poi-3.1-beta2/src"/>

Also are you sure that "poi-3.1-beta2/src" is the correct path? It sounded more like a path relative to the zip would be "src".
Comment 6 Andreas Goetz CLA 2008-06-06 07:20:27 EDT
Sorry, forgot the link:

http://mirror.serversupportforum.de/apache/poi/dev/src/poi-src-3.1-beta2-20080526.zip  
Comment 7 Jerome Lanneluc CLA 2008-06-06 07:31:39 EDT
It looks like the sources are not directly under "poi-3.1-beta2\src\" but they are under several subfolders like "poi-3.1-beta2\src\contrib\src\" or "poi-3.1-beta2\src\examples\src\", etc.

In this case the rootpath attribute cannot be used (unless you want a subset of the source). But internally we should detect all root paths.

Can you please tell me for which type(s) the source cannot be found? (I would need the fully qualified names of the types).
Comment 8 Andreas Goetz CLA 2008-06-06 07:38:57 EDT
I was looking for org.apache.poi.hssf.usermodel.HSSFSheet which now does show the source- even without hacking the .classpath file. Sorry- seems my testcase was borken, please close as invalid.
Comment 9 Jerome Lanneluc CLA 2008-06-06 07:45:30 EDT
Thanks for the quick feedback. Closing as invalid as requested.
Comment 10 Frederic Fusier CLA 2008-06-06 09:14:31 EDT
Verified by reporter