OPS4J
  Using pax-construct for spring-osgi
Added by test, last edited by Stuart McCulloch on Oct 12, 2007  (view change)

Labels

 
(None)
Under construction. Both the script and this page

Introduction

pax-import-spring-osgi is a script that will run Pax Construct scripts in order to import the necessary bundles for working with spring-osgi.
In order to be modular you can import different modules/parts based on your needs. You can do that by passing the required parts as parameters to the script.
Available parts are:

core
hibernate2
hibernate3
jpa
ibatis
toplink
jdo
jpa
webmvc
struts
portlet
utils

Examples of ussage

pax-import-spring-osgi core - imports the core part of osgi
pax-import-spring-osgi core hibernate3 - imports the core and hibernate3
pax-import-spring-osgi core hibernate3 struts - imports the core, hibernate3 and struts
pax-import-spring-osgi hibernate3 - imports only hibernate3

Installation instructions

  1. Follow the instructions to install the latest version of pax-construct (at least version 0.1.5) for example
    unzip scripts-0.1.6.zip
    Windows: set PATH=<path-to-pax-construct-0.1.6>\bin;%PATH%
    *nix/Mac: PATH=<path-to-pax-construct-0.1.6>/bin:$PATH; export PATH
  2. Next add the spring-osgi template scripts to the pax-construct bin directory
  3. Windows: Download and place it in pax-construct-0.1.6\bin
  4. *nix/Mac: Download and place it in pax-construct-0.1.6/bin, chmod u+x the file if necessary
  5. Enter the following commands in a temporary/working directory
    pax-create-project -g simple.project -a osgi-web-app
    cd osgi-web-app
    mvn install
    pax-import-spring-osgi core webmvc
    pax-create-bundle -p my.osgi.code.myBundle -n myBundle
    mvn install
  6. Import all the projects in eclipse (or use mvn pax:provision to start up Equinox from the command-line)

    There have been recent problems deploying Spring-OSGi M3 snapshots to the spring repository.
    If you build Spring-OSGi from source then you can use these scripts unchanged, as the artifacts
    will be in your local repository. If not then you can try using the released M2 artifacts instead.

    To use M2 open the pax-import-spring-osgi script in an editor and change any occurence of m3-SNAPSHOT to m2

Still to be done

  1. add imports to related libs as for example jdo, ibatis, hibernate2
  2. figure out how to avoid duplicate repo entries, maybe -o switch to pax-add-repository