Community
Participate
Working Groups
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>
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
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.
... 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?
closing since we have two related conversations going in #346174 and #334519 *** This bug has been marked as a duplicate of bug 334519 ***