Bug 422776 - Bundle is still unpacked although it specifies Eclipse-BundleShap: jar while "unpack" is not specifies at all in the feature
Summary: Bundle is still unpacked although it specifies Eclipse-BundleShap: jar while ...
Status: NEW
Alias: None
Product: PDE
Classification: Eclipse Project
Component: Build (show other bugs)
Version: 4.3   Edit
Hardware: PC Windows 7
: P3 normal with 6 votes (vote)
Target Milestone: ---   Edit
Assignee: pde-build-inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-28 10:29 EST by Michael Adada CLA
Modified: 2022-07-12 05:28 EDT (History)
2 users (show)

See Also:


Attachments
Attached a feature and plugin projects to illustrate and reproduce the issue (2.90 KB, application/octet-stream)
2013-11-28 10:35 EST, Michael Adada CLA
no flags Details
Attached a patch with a suggested fix to this issue (3.77 KB, patch)
2013-11-28 10:39 EST, Michael Adada CLA
no flags Details | Diff
Attached a test class to test the behavior (5.12 KB, text/java)
2013-11-28 10:42 EST, Michael Adada CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Adada CLA 2013-11-28 10:29:13 EST
First let me say that I know that there are already many similar open issues, however I didn't find any of them to contradict this one.

In this case the bundle specifies "Eclipse-BundleShap: jar" while the "unpack" attribute in the feature is not set at all, however the bundle ends up being unpacked which causes an error in our application.

This behavior only occurs when the "FeaturesAndBundlesPublisher" application is being used. (this adds the "<instruction key='zipped'>" to the content.xml file)
However when creating the archive using PDE from the Eclipse UI the redundant "<instruction key='zipped'>" entry is not added to the file.

According to the documentation "If a product uses PDE to build a feature based product then, if specified, the value of the unpack attribute in the feature.xml file takes precedence over the Eclipse-BundleShape header."
See: http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fbundle_manifest.html

As I understand it, if the "unpack" attribute is specified in the feature.xml file then this should take precedence over the Eclipse-BundleShape in the bundle, even if the feature.xml specified unpack="false" while the bundle specifies "Eclipse-BundleShape: jar" and the "Eclipse-BundleShape" attribute should be used only if it was not set at all in the feature.xml, as in our case.
Comment 1 Michael Adada CLA 2013-11-28 10:35:47 EST
Created attachment 237809 [details]
Attached a feature and plugin projects to illustrate and reproduce the issue

To reproduce this issue, import the feature and plugin project from the attached "feature_and_plugin.zip" file to your workspace and from Eclipse export the feature as a "Deployable Feature" (export to: C:\deploy)

Now from command line enter the following command:
\java -Dosgi.noShutdown=false  -jar <eclipse location>\plugins\org.eclipse.equinox.launcher.jar -application org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher  -metadataRepository file:/repo/ -artifactRepository file:/C:/repo/ -source C:/deploy -append -publishArtifacts

Checkout the content.xml file in C:/repo and see that the plugin is defined to be unpacked (<instruction key='zipped'>)
Comment 2 Michael Adada CLA 2013-11-28 10:39:38 EST
Created attachment 237810 [details]
Attached a patch with a suggested fix to this issue

The attached patch assumes that the behavior of "Eclipse-BundleShape" should be according to the documentation under: http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fbundle_manifest.html
Comment 3 Michael Adada CLA 2013-11-28 10:42:16 EST
Created attachment 237811 [details]
Attached a test class to test the behavior

The attached test is based on the behavior as described in the documentation, before applying the suggested patch this class will have 2 failed tests in it, after applying the patch the tests will pass.
Comment 4 Eclipse Genie CLA 2020-07-21 14:53:20 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 5 Eclipse Genie CLA 2022-07-12 05:28:23 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.