Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 247553 - Export-Package version when creating Plug-in from existing JAR archives
Summary: Export-Package version when creating Plug-in from existing JAR archives
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.5 M3   Edit
Assignee: Benjamin Cabé CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-16 16:03 EDT by Frederic Conrotte CLA
Modified: 2008-10-19 14:25 EDT (History)
2 users (show)

See Also:


Attachments
proposed patch (4.22 KB, patch)
2008-09-16 17:18 EDT, Benjamin Cabé CLA
no flags Details | Diff
mylyn/context/zip (2.28 KB, application/octet-stream)
2008-09-16 17:18 EDT, Benjamin Cabé CLA
no flags Details
updated patch (4.89 KB, patch)
2008-10-18 04:55 EDT, Benjamin Cabé CLA
caniszczyk: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frederic Conrotte CLA 2008-09-16 16:03:40 EDT
When using Eclipse to develop OSGi bundles you quite often need to "osgify" external libraries.

To do this you can use "File -> New -> Project -> Plug-in Development -> Plug-in from existing JAR archives"

When plug-in is created, the "Export-Package" entries in the generated MANIFEST do not hold any version attribute.

According to OSGi R4 specs it means exported packages do have version "0.0.0" instead of having the same version as the Bundle-Version meta tag.

Missing versioning from Export-Package and Import-Package meta tags is a common issue in OSGi development and specifying them is considered as a "best practice".

It would be great if the "Plug-in from existing JAR archives" functionality would by default add version attribute to ""Export-Package" entries.

The version value would be the same as the "Bundle-Version".
Comment 1 Benjamin Cabé CLA 2008-09-16 17:18:25 EDT
Created attachment 112707 [details]
proposed patch

it sounds fair

here is a patch to implement this behaviour
Comment 2 Benjamin Cabé CLA 2008-09-16 17:18:30 EDT
Created attachment 112708 [details]
mylyn/context/zip
Comment 3 Chris Aniszczyk CLA 2008-09-22 11:52:50 EDT
Ben, we should only be doing this if ONE jar is selected, it doesn't make sense to do this if multiple jars are selected as the versions may conflict.
Comment 4 Benjamin Cabé CLA 2008-10-18 04:55:30 EDT
Created attachment 115499 [details]
updated patch

Ouch, I didn't see your comment Chris, sorry!
I of course agree with your suggestion
Comment 5 Chris Aniszczyk CLA 2008-10-19 14:25:00 EDT
done.

> 20091019

Thanks Benjamin!