War Protocol

Pax URL War is an OSGi URL handler that automates war deployment. To do that war url handler will transform a war file by adding the necessary manifest headers based on a set of processing instructions or default assumptions.

Why

Imagine this. You have a standard war file that you want to deploy into an OSGi framework. For this to work it needs extra OSGi manifest headers and you do not want to preprocess the war file before deployment, and you are wondering why can't this process be done automatically. Well, it can. See bellow.

Syntax ( see examples )

war-uri := war-uri-auto | war-uri-ref
war-uri-auto := "war:" | "webbundle:" < rfc2396 uri > ; uri of the war file
war-uri-ref := "warref:" < rfc2396 uri > ; uri of a java properties file that contains custom war instructions

So, when you want to make a bundle out of your war using default instructions you will have to use the "war:" or "webbundle:" protocol and provide a url for the war file, and when you want to use custom instructions you have to use the "warref:" protocol and provide a url for the instructions file to use. Whatever of the two protocols you use, the handler will take the specified war file, scan the WEB-INF/lib directory for all the jars in order to create the Bundle-ClassPath instruction and toegether wth the default or provided instructions will use the BND tool to generate the OSGi bundle.

Instructions file syntax

The instructions file is a standard java properties that contains properties to be used while transforming the war into an OSGi compatible bundle. See Peter Kriens BND Tool for details about instructions. Beside those you have/can use the following wrap protocol specific instructions:

Mandatory properties
Optional properties

Any property that you specify will be added into the transformed war manifest file (META-INF/MANIFEST.MF) ([see] some useful properties). Some of the properties will have a special meaning as can be seen bellow:

Default instructions

By default the following will be used:

Configuration

The service can be configured in two ways: via configuration admin if available and via framework/system properties where the configuration via config admin has priority.

Option key Description
org.ops4j.pax.url.war.certicateCheck optional; true/false if the SSL certificate check should be done while accesing the war url and instructions url. Default false.

Examples

Create an OSGi compliant war file (bundle) using default instructions downloaded using http protocol:

war:http://repo1.maven.org/maven2/org/apache/wicket/wicket-examples/1.3.0/wicket-examples-1.3.0.war

Create an OSGi compliant war file (bundle) using default instructions downloaded using [mvn] protocol:

war:mvn:org.apache.wicket/wicket-examples/1.3.0/war

Create an OSGi compliant war file (bundle) using specific instructions downloaded using [mvn] protocol:

warref:jar:mvn:org.ops4j.pax.web-extender.samples/provision!/wicket-examples-1.3.0.bnd

Browse Space

- Pages
- News
- Labels
- Attachments
- Bookmarks
- Mail
- Activity
- Advanced

Explore Confluence

- Popular Labels
- Notation Guide

Your Account

Log In

Other Features

Add Content

- Add Comment


Click here to sign up for an account!
Clicky Web Analytics