Bug 135012 - [classpath] Content Assist not working for plugin dependency
Summary: [classpath] Content Assist not working for plugin dependency
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Linux
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 136004 136813 138355 197996 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-04-05 09:46 EDT by Paul Webster CLA
Modified: 2010-11-25 14:22 EST (History)
13 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Webster CLA 2006-04-05 09:46:31 EDT
I created a simple plugin com.ex.log that has a 3rd party jar in it (a single Log class), and export the package.

Then I create another plugin that depends com.ex.log.  Both com.ex.log and the new plugin work when self hosted, and can see the Log class through content assist and CTRL+SHIFT+R.

I deploy both plugins, start eclipse in a new workspace with -clean.  Both plugins continue to work as expected.

If I create a new plugin test.log in this workspace, I can add com.ex.log as a dependency.  But test.log can't see the Log class, and it won't show up in CTRL+SHIFT+R even though it's been exported from com.ex.log.  I can see any exported packages that are in the com.ex.log deployed plugin, just not exported packages that are in the com.ex.log plugin in the 3rd party jar.

The com.ex.log plugin has this manifest (which is correct):
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Log Plug-in
Bundle-SymbolicName: com.ex.log; singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: com.ex.log.Activator
Bundle-Vendor: EX
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
 org.eclipse.core.runtime
Eclipse-LazyStart: true
Bundle-ClassPath: lib/example_log.jar,
 .
Export-Package: com.example.log



PW
Comment 1 Wassim Melhem CLA 2006-04-07 01:32:43 EDT
This is a long-standing limitation.  Nested JARs are not supported by JDT(ie. cannot be put on the classpath nor can they be indexed).

Moving to jdt/core to resolve as appropriate.
Comment 2 Wassim Melhem CLA 2006-04-10 17:29:07 EDT
*** Bug 136004 has been marked as a duplicate of this bug. ***
Comment 3 Wassim Melhem CLA 2006-04-14 04:02:42 EDT
*** Bug 136813 has been marked as a duplicate of this bug. ***
Comment 4 Wassim Melhem CLA 2006-04-25 09:33:08 EDT
*** Bug 138355 has been marked as a duplicate of this bug. ***
Comment 5 Nicolas Jouanin CLA 2006-11-15 06:46:02 EST
Hi,

I'm currently faced to the same problem : some jar file included (and exported) in a plugin are not accessible to JDT.
This is hardware and OS independant as i've tested it on XP or MacOS both running Eclipse 3.2.1.
Comment 6 Wassim Melhem CLA 2007-02-08 13:42:39 EST
Frederic, is there a plan to do something on the JDT side here?

I am not aware of any compiler out there that can handle nested JARs.

Interestingly, there is an enhancement request in the PDE bucket (bug 111238) that would handle extraction of JARs for JDT.  

We have not assessed the risk/benefit ratio yet.  

Shipping plug-ins as nested JARs is not a recommmended format anyway.
Comment 7 Walter Harley CLA 2007-02-08 14:15:45 EST
(In reply to comment #6)
> Shipping plug-ins as nested JARs is not a recommmended format anyway.

Yes, but shipping expanded plug-ins is also not recommended.  So if you want to package up a third-party jar whose licensing terms don't permit it to be unpacked and included with all the other classes, there is no right answer.

Also, ISTR that when I tried unpacking a third-party jar I ran into other problems with PDE that made it difficult to export a class folder into the plug-in; the memory is vague now (it was two years ago) but I think it had to do with not being able to have a consistent runtime classpath between my dev and deployed environments, i.e. I needed to have both "lib" and "." on my runtime classpath even though in any particular environment only one was being used.  We ended up resorting to checking in the source code for the third-party jar and letting it be compiled as if it were our own source, which was skirting the limits of the licensing terms of that jar.

Bottom line: when plug-ins need to include both source code and third-party jars, there does not seem to be a clean or correct "best practice" that will support development, testing, and deployment.
Comment 8 Jerome Lanneluc CLA 2007-06-20 07:53:56 EDT
Marking as enhancement as we would need to support nested jars.
Comment 9 Wassim Melhem CLA 2007-07-26 14:14:13 EDT
*** Bug 197996 has been marked as a duplicate of this bug. ***
Comment 10 Max Rydahl Andersen CLA 2007-07-27 05:25:22 EDT
Why is this jar different than any other nested jar ?

e.g. I have many plugins that have nested jars in it to have access to e.g. hibernate, log4j, etc.

Comment 11 Jerome Lanneluc CLA 2007-08-09 05:28:08 EDT
(In reply to comment #10)
> Why is this jar different than any other nested jar ?
> 
> e.g. I have many plugins that have nested jars in it to have access to e.g.
> hibernate, log4j, etc.
> 
We simply don't have support to have a classpath entry point at a jar file inside another jar file. So we cannot resolve the classes inside the nested jar.
Comment 12 Jacek Pospychala CLA 2009-08-06 06:49:20 EDT
Isn't it a duplicate of bug 111238?