Controlling dependency startLevel [message #1839177] |
Tue, 16 March 2021 20:43 |
Adam Saturna Messages: 4 Registered: March 2021 |
Junior Member |
|
|
We are using p2 to provision our servers using p2 Update Sites that we build.
Recently, I have upgraded Jetty to a newer version. Our UpdateSite contains all required jetty bundles. Some of our bundles contain JSP pages. The default bundle startLevel is 4, and so when we provision our changes, Jetty + our own bundles end up with startLevel 4 in bundles.info file.
This is an issue because if our JSP containing bundles start before jetty bundles that offer JSP support, the Bundle Tracker will miss them and will not configure WebAppContext correctly.
I need org.mortbay.jasper-apache-jsp bundle to start before our bundles do.
I have tried unpacking the source bundle jar and added p2.inf file inside META-INF directory and repacked the jar.
I can't get it to work correctly, the following is my p2.inf content:
#create a requirement on the fragment we are creating
requires.0.namespace=org.eclipse.equinox.p2.iu
requires.0.name=configure.org.example.bundle
requires.0.range=[$version$,$version$]
requires.0.greedy=true
#create a IU fragment named configure.<org.myBundle>
units.0.id=configure.<org.myBundle>
units.0.version=$version$
units.0.provides.1.namespace=org.eclipse.equinox.p2.iu
units.0.provides.1.name=configure.org.example.bundle
units.0.provides.1.version=$version$
units.0.instructions.install=org.eclipse.equinox.p2.touchpoint.eclipse.installBundle(bundle:${artifact});
units.0.instructions.uninstall=org.eclipse.equinox.p2.touchpoint.eclipse.uninstallBundle(bundle:${artifact});
units.0.instructions.unconfigure=org.eclipse.equinox.p2.touchpoint.eclipse.setStartLevel(startLevel:-1); \
org.eclipse.equinox.p2.touchpoint.eclipse.markStarted(started:false);
units.0.instructions.configure=org.eclipse.equinox.p2.touchpoint.eclipse.setStartLevel(startLevel:3); \
org.eclipse.equinox.p2.touchpoint.eclipse.markStarted(started:true);
units.0.hostRequirements.1.namespace=osgi.bundle
units.0.hostRequirements.1.name=<org.myBundle>
units.0.hostRequirements.1.range=[<v>, <v>]
units.0.hostRequirements.1.greedy=false
units.0.hostRequirements.2.namespace=org.eclipse.equinox.p2.eclipse.type
units.0.hostRequirements.2.name=bundle
units.0.hostRequirements.2.range=[1.0.0,2.0.0)
units.0.hostRequirements.2.greedy=false
units.0.requires.1.namespace=osgi.bundle
units.0.requires.1.name=<org.myBundle>
units.0.requires.1.range=[<v>, <v>]
units.0.requires.1.greedy=false
When I include this in the jsp bundle, the provisioner fails to install the bundle.
I have tried debugging with org.eclipse.equinox.p2.core/planner/projector=true but that doesn't give me a lot of info why the config fragment dependency is not satisfied.
Any suggestions how I can get this to work? I've been extensively searching the web but no luck.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03871 seconds