Community
Participate
Working Groups
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
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.
(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.
You can see the zip for yourself here.
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?
(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".
Sorry, forgot the link: http://mirror.serversupportforum.de/apache/poi/dev/src/poi-src-3.1-beta2-20080526.zip
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).
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.
Thanks for the quick feedback. Closing as invalid as requested.
Verified by reporter