Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 43406

Summary: [migration] Invalid assumptions regarding the form of URLs
Product: [Eclipse Project] Equinox Reporter: Jeff McAffer <jeffmcaffer>
Component: IncubatorAssignee: User Unknown <unknown1>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: birsan, email, konradk, pascal
Version: unspecified   
Target Milestone: 3.0 M7   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Jeff McAffer CLA 2003-09-22 00:37:58 EDT
Who is affected: Plugins which make the assumption that they are installed in a 
directory in the local file system.

Description: Methods such as IPluginDescriptor.getInstallURL() return URLs of a 
particular form. Despite this form not being specified, various plugins make 
assumptions based on the current implementation. For example, they expect to 
get a file: URL and use URL.getFile() and use java.io.File manipulation. This 
has been a workable but rather unsafe approach. Under the OSGi runtime there 
are more cases where the assumptions are invalid. 

Analysis: While these are technically not breaking API changes, they will 
likely result in some number of broken plugins. Plugin writers should ensure 
that the information to which they need access is available via getResource() 
or use the new Bundle.getEntry() API.
Comment 1 Jeff McAffer CLA 2003-09-23 22:47:41 EDT
Updated description/analysis...

Who is affected: Plug-ins which make assumptions regarding their installation 
structure, location and the local file system layout.

Description: Methods such as IPluginDescriptor.getInstallURL() return URLs of a 
particular form. Despite this form not being specified, various plug-ins make 
assumptions based on the current implementation. For example, they may expect 
to get a file: URL and use URL.getFile() and use java.io.File manipulation on 
the result. To date, this has been a workable but rather unsafe approach. For 
example, if a plug-in is installed on a web server, it is possible that an 
http: URL would be returned. The OSGi runtime opens more possibilities for 
execution configurations (e.g., maintaining whole plugins in JARs rather than 
exploded in directories). 

Analysis: The new runtime does not actually break current behaviour but as 
described above, it exposes more cases where current assumptions are invalid. 
Plug-in writers should ensure that the information to which they need access is 
available via getResource(), use the relevant API for accessing the contents of 
a bundle/plug-in.
Comment 2 Michael Forster CLA 2003-12-11 03:29:47 EST
Is there some documentation available, how the equinox can be used 
to "maintain whole plugins in JARs rather than exploded in directories" as 
mentioned in comment 1?

[BTW: The Equinox migration guide 
http://dev.eclipse.org/viewcvs/indextech.cgi/~checkout~/equinox-
home/alternateRuntimes/migration.html incorrectly links to Bug 43658 instead 
of this one]
Comment 3 Jeff McAffer CLA 2003-12-11 09:11:07 EST
the work to put whole plugins in jars will be done in January.  At this point 
various parts of Eclipse are likely making assumptions of the form discussed 
here.  We will be going through and finding/fixing those assumptions.  The 
general idea is that one could take the update site plugin jar and install it 
without exploding.  We will also likely investigate alternative structurings so 
that we don't have to extract the code jars out of the plugin jar (or pay some 
performance cost).  Stay tuned to this space.

Thanks for the pointer on the doc.  That one is actually obsolete now.  I will 
put in a forwarding pointer.  the new doc does not have the bug references but 
the bug titles are generally the same as the doc section titles so a query will 
find them.
Comment 4 Michael Forster CLA 2003-12-11 10:02:00 EST
Thank you, Jeff, for explaining. I am not sure however, if we talk about the 
same thing. I am not asking, whether the existing Eclipse plugins can be 
launched from JARs, but rather whether the runtime itself allows to run 
plugins from JARs by now.

I'd like to take the runtime and write some _new_ plugins, extending the 
org.eclipse.core.runtime.applications extension Point. I am asking whether 
these yet to write plugins could be run from a JAR.
Comment 5 Pascal Rapicault CLA 2003-12-11 10:25:07 EST
As of today the runtime does not support running plugins out of jars 
(everything in one jar instead of exploded on disk).

This capability will be explored in january.
Comment 6 Jeff McAffer CLA 2003-12-11 11:16:17 EST
Just to be brutally clear on this, the actual OSGi framework underneath does 
support running from jars today.  The Eclipse runtime layered on top and 
adaptor inserted underneath makes some assumptions that preclude this from 
working.
Comment 7 Michael Forster CLA 2003-12-11 11:27:06 EST
Thank you, very much, for the clarification. Looking forward to January :-)
Comment 8 Jeff McAffer CLA 2004-01-22 10:21:22 EST
support for running from jars is well underway and on track for M7 release.  
The original topic of this bug is resolved and documented in the porting 
guide.  Closing.
Comment 9 Nick Minutello CLA 2004-09-06 22:03:46 EDT
Any chance of posting a link to the porting guide you speak of?
I have looked at the Eclipse 3.0 Migration guide, but didnt read anything 
related to this issue... Maybe I missed it?