Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 319306 - Remove the Require-Bundle in org.eclipse.jetty.osgi.boot
Summary: Remove the Require-Bundle in org.eclipse.jetty.osgi.boot
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: osgi (show other bugs)
Version: 7.1.5   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 7.1.x   Edit
Assignee: Hugues Malphettes CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-08 14:51 EDT by Hugues Malphettes CLA
Modified: 2010-10-13 17:53 EDT (History)
4 users (show)

See Also:
gregw: iplog+


Attachments
jetty-osgi-boot pom w/o require-bundles (5.00 KB, text/xml)
2010-07-21 08:22 EDT, Dmytro Pishchukhin CLA
no flags Details
jetty-osgi-boot-jsp updated pom (8.87 KB, text/xml)
2010-07-21 08:23 EDT, Dmytro Pishchukhin CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hugues Malphettes CLA 2010-07-08 14:51:32 EDT
The goal is to accomodate the jetty aggregate that can be now consumed in an OSGi environment. See bug 317222
Comment 1 Dmytro Pishchukhin CLA 2010-07-21 08:22:13 EDT
Created attachment 174838 [details]
jetty-osgi-boot pom w/o require-bundles

./META-INF/MANIFEST.MF could be removed
Comment 2 Dmytro Pishchukhin CLA 2010-07-21 08:23:14 EDT
Created attachment 174839 [details]
jetty-osgi-boot-jsp updated pom

./META-INF/MANIFEST.MF could be removed
Comment 3 Hugues Malphettes CLA 2010-07-21 14:05:18 EDT
Many thanks Dmytro.
Comment 4 Hugues Malphettes CLA 2010-07-26 15:19:34 EDT
Dmytro,

The patched pom for jetty-osgi-boot-jsp works for me but it really does produce the same than the current build. I am inclined to keep the current code as it is; it fits the eclipse PDE style for the development of an OSGi bundle.

The patched jetty-osgi-boot pom.xml is not clear to me:
In my testing, I must remove the existing MANIFEST.MF to eliminate the Require-Bundle instructions: BND will merge the pom's configuration and the existing MANIFEST.MF otherwise.
Once I remove the existing MANIFEST.MF the list of import packages is surprisingly small. For sure we need to specify a couple starting with the servlet packages otherwise the imported servlet API will not be consistent with what the rest of jetty-7 imports: 2.5.

Also BND will only detect the org.eclipse.jetty packages that are explicitly used in java classes of this bundle.
However this bundle need to be able to access any of the org.eclipse.jetty objects that could be declared in a jetty.xml configuration file.

The easiest solution I believe if we don't want to use Require-Bundle is to use a DynamicImport-Package

Here are the set of instructions that I think will do what we want. 
                    <instructions>
                        <Bundle-SymbolicName>org.eclipse.jetty.osgi.boot;singleton:=true</Bundle-SymbolicName>
                        <Export-Package>org.eclipse.jetty.osgi.boot,org.eclipse.jetty.osgi.boot.utils</Export-Package> 
                        <Bundle-Activator>org.eclipse.jetty.osgi.boot.JettyBootstrapActivator</Bundle-Activator>
                        <Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy> 
                        <!-- disable the uses directive: jetty will accomodate pretty much any versions
                        of the packages it uses; no need to reflect some tight dependency determined at
                        compilation time. --> 
                        <_nouses>true</_nouses>
                        <Import-Package>javax.mail;version="1.4.0";resolution:=optional,
 javax.mail.event;version="1.4.0";resolution:=optional,
 javax.mail.internet;version="1.4.0";resolution:=optional,
 javax.mail.search;version="1.4.0";resolution:=optional,
 javax.mail.util;version="1.4.0";resolution:=optional,
 javax.servlet;version="2.5.0",
 javax.servlet.http;version="2.5.0",
 javax.transaction;version="1.1.0";resolution:=optional,
 javax.transaction.xa;version="1.1.0";resolution:=optional,
 org.osgi.framework,
 org.osgi.service.cm;version="1.2.0",
 org.osgi.service.packageadmin,
 org.osgi.service.startlevel;version="1.0",
 org.osgi.service.url;version="1.0.0",
 org.osgi.util.tracker;version="1.3.0",
 org.slf4j;resolution:=optional,
 org.slf4j.spi;resolution:=optional, 
 org.slf4j.helpers;resolution:=optional,
 org.xml.sax,
 org.xml.sax.helpers,
 *
                        </Import-Package>
                        <DynamicImport-Package>org.eclipse.jetty.*;version=[7.2,8)</DynamicImport-Package>
                        <!--Require-Bundle/-->
                        <Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment> 
                    </instructions>

Comments and review welcome.
Comment 5 Hugues Malphettes CLA 2010-07-26 22:27:24 EDT
I have added an ant task to the pom.xml to delete the MANIFEST.MF copied from the sources. This way we can continue to use the PDE to develop this plugin.
Fixed as described above.