Monday, June 4, 2012

Using Pax Construct

history:
git clone https://github.com/ops4j/org.ops4j.pax.construct.git
cd org.ops4j.pax.construct
mvn clean install
mvn site


file:///Users/alec/product/pax-construct/org.ops4j.pax.construct/target/site/index.html

http://repo1.maven.org/maven2/org/ops4j/pax/construct/scripts/1.5/scripts-1.5.zip

Spring DM Example:
#!/bin/sh

#--------------------------------
# let's start with a new project
#--------------------------------

pax-create-project -g examples -a spring

cd spring

#-----------------------------------------------------------------------------------
# first import the Spring Dynamic-Modules Extender bundle - we use importTransitive
# to also import any bundles it depends on and widenScope to do an exhaustive check
# of all dependencies (normally only "provided" scope dependencies are checked)
#-----------------------------------------------------------------------------------

pax-add-repository -i com.springsource.repository.bundles.external -u http://repository.springsource.com/maven/bundles/external

pax-import-bundle -g org.springframework.osgi -a spring-osgi-extender -v 1.1.2 -- -DimportTransitive -DwidenScope

#------------------------------------------------------------
# create new OSGi service bundle with example code and tests
#------------------------------------------------------------

pax-create-bundle -p org.example.service -- -Djunit

#--------------------------------------------------------------------
# create new Spring Dynamic Modules bean with example code and tests
#--------------------------------------------------------------------

pax-create-bundle -p org.example.bean -- -Dspring -Djunit

#----------------------------
# finally, build and deploy!
#----------------------------

exec mvn clean install pax:provision "-Dframework=equinox"

No comments:

Post a Comment