Dashboard > OPS4J > ... > Pax > Pax URL > Pax URL - Modules > Pax URL - war
  OPS4J Log In View a printable version of the current page.  
  Pax URL - war
Added by Alin Dreghiciu, last edited by Alin Dreghiciu on Apr 11, 2008  (view change)
Labels: 

Overview
   

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-inst
war-uri-auto := "war:" < rfc2396 uri > ; uri of the war file
war-uri-inst := "war-i:" < 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:" protocol and provide a url for the war file, and when you want to use custom instructions you have to use the "war-i:" 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
  • WAR-URL — < rfc2396 uri >; url of the war file to be transformed
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:

  • Bundle-SymbolicName — If not specified the bundle symbolic name will be generate out of War-URI where all characters that are one of [a-zA-Z_0-9-\.] are replaced with "."
  • Webapp-Context — no default value (War Extender will use Bundle-SymbolicName as default)
  • Bundle-ClassPath — you can provide any class path entries you need and the following entries will be added automatically:
    • .
    • WEB-INF/classes
    • all jars from WEB-INF/lib directory

Default instructions

By default the following will be used:

  • import all packages that:
    • start with javax;
    • start with org.org.xml
    • start with org.w3c
  • no packages will be exported
  • WAR-URL (see above) will be the provided url ( everything after "war-i:" )
  • Default instructions (see above) 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:

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

Issue tracker

Issues, bugs, and feature requests can be submitted to the issue tracking system.

   
Usage
   

System requirements

  • any OSGI R4 compilant framework

Manual installation

Pax Runner installation

pax-run mvn:org.ops4j.pax.url/pax-url-war

Source code

https://scm.ops4j.org/repos/ops4j/projects/pax/url/pax-url-war ( or browse via FishEye )
This project builds with Apache Maven and uses Apache Felix's maven-bundle-plugin, and Peter Kriens bnd tool.

   
Latest News
   

Pax URL 0.3.1 has been released.

Checkout release notes for details.

Posted at 02 Jun @ 4:55 PM by Alin Dreghiciu | 0 comments

Pax URL 0.3.0 has been released.
This release highlights are:

Checkout release notes for details.

Posted at 23 Feb @ 1:23 PM by Alin Dreghiciu | 0 comments

Pax URL 0.2.1 has been released.
This is a maintenance addressing performance issues on maven artifact discovery.

Checkout release notes for details.

Posted at 08 Feb @ 8:30 AM by Alin Dreghiciu | 0 comments

Pax URL 0.2.0 has been released.
This release highlights are:

  • new protocol handler for OBR
  • improved maven artifact resolution
  • support for maven version ranges

Checkout release notes for details.

Posted at 05 Feb @ 10:08 AM by Alin Dreghiciu | 0 comments

Pax URL 0.1.0 has been released.

Posted at 26 Jan @ 1:02 PM by Alin Dreghiciu | 0 comments
   

Site running on a free Atlassian Confluence Open Source Project License granted to ops4j.org. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.4.5 Build:#708 Apr 12, 2007) - Bug/feature request - Contact Administrators
Click here to sign up for an account!