Friday, October 19

Migrate existing OSGi projects to the latest Pax-Construct

I'm currently tinkering with a Maven mojo to help people migrate old Pax-Construct (0.1.x) and other OSGi projects to the new Pax-Construct layout. At the moment this mojo only captures the project layout and types of bundles (wrapper, compiled, imported, etc.) but will eventually include the actual bundle source, BND instructions, and other POM customization - like extra repositories.

To try out the new mojo, either download the latest 0.2.1-SNAPSHOT scripts and use the pax-validate command to pull down the latest maven-pax-plugin, or build from the latest sources.

Then go to your OSGi project and call:

mvn org.ops4j:maven-pax-plugin:0.2.1-SNAPSHOT:clone

which should generate both UNIX and Windows build scripts under the target folder.

Make sure the 0.2.1-SNAPSHOT Pax-Construct scripts are on your path, and cd to a temporary directory - you should then be able to call the generated build script, which will recreate the project structure using the latest Pax-Construct commands.

For example:

cd ~/Code/ops4j/pax/radman ; mvn org.ops4j:maven-pax-plugin:0.2.1-SNAPSHOT:clone

cd /tmp ; ~/Code/ops4j/pax/radman/target/pax-clone-radman

If you want to make sure there's only one main project, use the -DunifyRoot Maven property to bring any disconnected (ie. parent-less) modules under the same root project.

Feel free to try it out and feedback any issues / requests via the OPS4J JIRA site as usual - enjoy!

Friday, October 12

Rapid OSGi development : Pax-Construct 2 goes GA

I've just made the new version of Pax-Construct generally available on the OPS4J repository:

http://repository.ops4j.org/maven2/org/ops4j/pax/construct/scripts/0.2.0-ga/scripts-0.2.0-ga.zip

detailed documentation for the scripts and Maven2 plugins can be found on the following site:

http://www.ops4j.org/projects/pax/construct/index.html

including an example of using Pax-Construct to assemble and deploy Spring Dynamic Modules!

http://www.ops4j.org/projects/pax/construct/examples/spring-osgi.html

Other noteworthy features:

  • much simpler project layout - you can even create standalone bundle POMs
  • transitive wrapping of third-party jars and their dependencies
  • transitive importing of OSGi bundles and their bundle dependencies
  • new scripts to help move bundles around the project
  • supports the latest release of Pax-Runner!
I'm away in Penang for the next few days, but will be back soon to answer questions and provide many more examples. In the meantime, feel free to comment on the wiki, or raise issues on JIRA :)

Launching Spring Dynamic Modules using Pax-Runner

My fellow OPS4J'r Alin Dreghiciu has produced a really cool screencast showing how you can quickly deploy Spring-OSGi M3 using his recently released version of Pax-Runner:

http://wiki.ops4j.org/confluence/x/SwBN

You can also read more about the ongoing Pax-Runner story at:

http://wiki.ops4j.org/confluence/x/A4A6

Support for the major OSGi frameworks, flexible configuration, directory and maven scanners - what more could you want? (if yes, please mention it on JIRA!)

Alin's screencast is now linked from the Spring Dynamic Modules site:

http://www.springframework.org/osgi

well done Alin!