Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311861 - p2.director ignore exported system.bundle packages when resolve Import-Package
Summary: p2.director ignore exported system.bundle packages when resolve Import-Package
Status: CLOSED DUPLICATE of bug 334519
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.5.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: P2 Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-06 08:02 EDT by Nikolas Falco CLA
Modified: 2011-05-17 19:51 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nikolas Falco CLA 2010-05-06 08:02:24 EDT
Build Identifier: 3.6.0.I20100312-1448

I'm trying to install a feature from a p2 repository using p2.director.
During install if a bundle declare an Import-Package that system.bundle offer p2.director ignore it and search for a bundle which satisfy that Import-Package.

A simple example: a feature that include plugin javax.mail 1.4 downloaded from orbit page.

Error Log:
[echoproperties] org.osgi.framework.system.packages=...javax.net,javax.net.ssl,....
[p2.director] Missing requirement: Javax Mail Plug-in 1.4.0.v200905040518 (javax.mail 1.4.0.v200905040518) requires 'package javax.net.ssl 0.0.0' but it could not be found.


I have this problem in my headless build. As workaround I create a plugin from rt JAR and export all javax.* including it in a feature (but it must not be delivered with product).

Reproducible: Always

Steps to Reproduce:
1.Install javax.mail plugin into your ecplise
2.Create a new feature call test
3.Declare test feature include plugin javax.mail
4.Export it as "Deployable feature"
5.Create metadata and artifact for it (for example with an ant task <p2.publish.featuresAndBundles source="exportedDeployableDeatureFolder" repository="file:/targetFolder" />
6.Launch p2.director ant task <p2.director
            artifactrepository="file:/targetFolder"
            metadatarepository="file:/targetFolder"
            destination="/tmp/test">
            <iu id="test.feature.group" />
        </p2.director>
Comment 1 Andrew Niefer CLA 2010-05-06 10:58:44 EDT
Product export produces an IU named "a.jre.<execution environment>" which provides the exports for the system bundle for the corresponding EE.

Currently this just creates a 1.6 IU (a.jre.javase_1.6.0) and we don't have any commandline or ant tasks for doing this independently of a product.

One possibility would be to do a small product export and then mirror the a.jre IU from the resulting repository
Comment 2 Nikolas Falco CLA 2010-05-06 11:18:49 EDT
Great workaround!

Heretofore I didn't known the product export trick before now.
I hope will be plan an ant task (or directly into p2.director task by attribute like exportpackage="true") to create these IUs automatically.

Thank for now.
Comment 3 Tobias Oberlies CLA 2010-10-05 04:29:53 EDT
... but it is a workaround with a severe drawback: It prevents that p2 can select additional bundles depending on the execution environment. If you want to support for example JavaSE-1.6 and OSGi/Minimum-1.2, afaik p2 can not be convinced automatically install an additional bundle, e.g. providing javax.xml.stream, in a OSGi/Minimum-1.2 installation, if the feature/bundle to be installed imports javax.xml.stream.

Are there any (concrete?) plans to make a p2 installation aware of the execution environment it is intended for?
Comment 4 Pascal Rapicault CLA 2011-05-17 19:51:50 EDT
closing since we have two related conversations going in #346174 and #334519

*** This bug has been marked as a duplicate of bug 334519 ***