SlideShare a Scribd company logo
1 of 17
Download to read offline
Maven tools for OSGi
Stuart McCulloch, V.P. OSGi Jayway Malaysia
Technical Sessions - Short Talks June 27, 2007 - 11:10AM
2Jayway Malaysia
Maven tools for OSGi
• Goal
• Introduce Maven tools to help you get started with OSGi.
• No time to cover all OSGi tooling – there is a wide variety.
• Industry Benefits
• Gradual learning curve – concentrate on code not build.
• Good integration with popular Java IDEs (Eclipse, IDEA).
3Jayway Malaysia
Maven
• Tool for building & managing Java projects
• Project Object Model (pom.xml)‫‏‬
• well-defined build life-cycle
• extensible plugin system
• Supports remote and local repositories
• dynamically fetch plugins / dependencies
• Build artifacts have unique identifiers
• groupId, artifactId, version
4Jayway Malaysia
Bnd tool
• Create OSGi bundle from
• classpath (jars, class folders)‫‏‬
• simple instructions
• Uses Pull approach
• contents defined by instructions
• generates OSGi metadata for you
5Jayway Malaysia
Bnd tool (continued)‫‏‬
• Can be used as
• command-line tool
• ant task
• maven plugin
• eclipse plugin
6Jayway Malaysia
maven-bundle-plugin
• New packaging type: bundle
• uses Bnd tool to create the OSGi artifact
• default instructions from Maven project
• can be configured further in pom.xml
• Simple migration for existing projects
• change packaging from jar to bundle
7Jayway Malaysia
Pax Construct
• Templates to kick-start development
• project / bundles / common techniques
• Simple scripts (Windows and *nix)‫‏‬
• Maven pax plugin
• manages project build files
• Eclipse support (extends maven-eclipse-plugin)‫‏‬
• OSGi provisioning (Equinox, Knopflerfish, Felix)‫‏‬
8Jayway Malaysia
Example – starting a new project
pax-create-project -g com.example
-a osgi-test
osgi-test
__poms
__compiled
__imported
__wrappers
9Jayway Malaysia
Example – create an OSGi bundle
pax-create-bundle -p com.example.client
-n simple-test-client
osgi-test
__poms
__simple-test-client
__src (template code)
__target (build output)‫‏‬
10Jayway Malaysia
Example – wrap jar as OSGi bundle
pax-wrap-jar -g net.sf.kxml
-a kxml2
-v 2.2.2
osgi-test
__poms
__simple-test-client
__net.sf.kxml.kxml2
11Jayway Malaysia
Example – import an OSGi bundle
pax-import-bundle -g org.ops4j.guice-osgi
-a org.ops4j.guice-osgi.core
-v 0.1.0-SNAPSHOT
osgi-test
__poms
__simple-test-client
__net.sf.kxml.kxml2
__org.ops4j.guice-osgi.core
12Jayway Malaysia
Example – embed jar inside bundle
pax-embed-jar -g net.sf.kxml -a kxml2 -v 2.2.2
Include-Resource:
target/kxml2.jar=target/kxml2.jar
Bundle-ClassPath:.,target/kxml2.jar
• Also supports unpacking of jars inside bundles
• benefit: can compile against the bundle
• downside: lose encapsulation / separation
13Jayway Malaysia
Example – unpacking a jar
pax-embed-jar -g aopalliance -a aopalliance
-v 1.0 -- -Dunpack=true
Include-Resource:
@target/aopalliance.jar,
target/aopalliance.jar=_placeholder_.jar
Bundle-ClassPath:.,target/aopalliance.jar
• note: additional entries are there to satisfy Eclipse PDE
14Jayway Malaysia
Example – build and provision
mvn clean install pax:provision
______ ________ __ __
/ __ / / __ / / / / /
/ ___/ / __ / _  _/
/ / / / / / / _ 
/__/ /__/ /__/ /_/ /_/
Pax Runner from OPS4J - http://www.ops4j.org
--------------------------------------------
Working Dir: /home/stuart/Code/ops4j/lab/guice-osgi/target/runner/work
Starting: org.ops4j.guice-osgi, runner, 0.1.0-SNAPSHOT
Name: Guice-OSGi
Description: Lab project investigating using Guice to inject OSGi services
Starting: org.ops4j.guice-osgi, runner, 0.1.0-SNAPSHOT
Platform: equinox
osgi>
15Jayway Malaysia
Example – import to Eclipse PDE
16Jayway Malaysia
Summary
• Maven
• flexible build system for Java
• Bnd tool
• create and verify OSGi bundles
• Pax Construct
• quick way to start OSGi projects
There are many more tools for OSGi...
17Jayway Malaysia
Resources
• Maven
• http://maven.apache.org
• Bnd tool
• http://www.aqute.biz/Code/Bnd
• maven-bundle-plugin
• http://cwiki.apache.org/FELIX/maven-bundle-plugin-bnd.html
• Pax Construct
• http://wiki.ops4j.org/confluence/display/ops4j/Pax+Construct

More Related Content

What's hot

What's hot (20)

Continuous delivery w projekcie open source - Marcin Stachniuk
Continuous delivery w projekcie open source - Marcin StachniukContinuous delivery w projekcie open source - Marcin Stachniuk
Continuous delivery w projekcie open source - Marcin Stachniuk
 
Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010
Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010
Java EE 6 & GlassFish V3 - Alexis Moussine-Pouchkine - May 2010
 
twMVC#44 如何測試與保護你的 web application with playwright
twMVC#44 如何測試與保護你的 web application with playwrighttwMVC#44 如何測試與保護你的 web application with playwright
twMVC#44 如何測試與保護你的 web application with playwright
 
Nuxeo and JavaScript
Nuxeo and JavaScriptNuxeo and JavaScript
Nuxeo and JavaScript
 
An Intro into webpack
An Intro into webpackAn Intro into webpack
An Intro into webpack
 
Treinamento frontend
Treinamento frontendTreinamento frontend
Treinamento frontend
 
Bundle your modules with Webpack
Bundle your modules with WebpackBundle your modules with Webpack
Bundle your modules with Webpack
 
How is Java / JVM built ? Adopt OpenJDK is your answer !
How is Java / JVM built ? Adopt OpenJDK is your answer !How is Java / JVM built ? Adopt OpenJDK is your answer !
How is Java / JVM built ? Adopt OpenJDK is your answer !
 
Bundling your front-end with Webpack
Bundling your front-end with WebpackBundling your front-end with Webpack
Bundling your front-end with Webpack
 
GWTcon 2015 - Best development practices for GWT web applications
GWTcon 2015 - Best development practices for GWT web applications GWTcon 2015 - Best development practices for GWT web applications
GWTcon 2015 - Best development practices for GWT web applications
 
How is Java / JVM built ? Back then and now...
How is Java / JVM built ? Back then and now...How is Java / JVM built ? Back then and now...
How is Java / JVM built ? Back then and now...
 
002. Working with Webpack
002. Working with Webpack002. Working with Webpack
002. Working with Webpack
 
JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM
JBCNConf: jBPM & Vert.x Reactive and Polyglot BPMJBCNConf: jBPM & Vert.x Reactive and Polyglot BPM
JBCNConf: jBPM & Vert.x Reactive and Polyglot BPM
 
005. a React project structure
005. a React project structure005. a React project structure
005. a React project structure
 
Webpack and Web Performance Optimization
Webpack and Web Performance OptimizationWebpack and Web Performance Optimization
Webpack and Web Performance Optimization
 
EWD 3 Training Course Part 15: Using a Framework other than jQuery with QEWD
EWD 3 Training Course Part 15: Using a Framework other than jQuery with QEWDEWD 3 Training Course Part 15: Using a Framework other than jQuery with QEWD
EWD 3 Training Course Part 15: Using a Framework other than jQuery with QEWD
 
GlassFish v3 Prelude Aquarium Paris
GlassFish v3 Prelude Aquarium ParisGlassFish v3 Prelude Aquarium Paris
GlassFish v3 Prelude Aquarium Paris
 
Nuxeo World Session: Building Packages for the Nuxeo Marketplace
Nuxeo World Session: Building Packages for the Nuxeo MarketplaceNuxeo World Session: Building Packages for the Nuxeo Marketplace
Nuxeo World Session: Building Packages for the Nuxeo Marketplace
 
Django framework
Django frameworkDjango framework
Django framework
 
Webpack: from 0 to 2
Webpack: from 0 to 2Webpack: from 0 to 2
Webpack: from 0 to 2
 

Similar to Maven tools - Stuart McCulloch, V.P. OSGi, Jayway Malaysia

Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
mfrancis
 

Similar to Maven tools - Stuart McCulloch, V.P. OSGi, Jayway Malaysia (20)

OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
 
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application DevelopmentOSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
OSGi and Java EE: A Hybrid Approach to Enterprise Java Application Development
 
GlassFish OSGi - Java2days 2010
GlassFish OSGi - Java2days 2010GlassFish OSGi - Java2days 2010
GlassFish OSGi - Java2days 2010
 
OSGi and Java EE in GlassFish - Tech Days 2010 India
OSGi and Java EE in GlassFish - Tech Days 2010 IndiaOSGi and Java EE in GlassFish - Tech Days 2010 India
OSGi and Java EE in GlassFish - Tech Days 2010 India
 
Introduction to OSGi - Part-1
Introduction to OSGi - Part-1Introduction to OSGi - Part-1
Introduction to OSGi - Part-1
 
OTN Developer Days - GlassFish
OTN Developer Days - GlassFishOTN Developer Days - GlassFish
OTN Developer Days - GlassFish
 
Modular Java applications with OSGi on Apache Karaf
Modular Java applications with OSGi on Apache KarafModular Java applications with OSGi on Apache Karaf
Modular Java applications with OSGi on Apache Karaf
 
OSGi & Java EE in GlassFish
OSGi & Java EE in GlassFishOSGi & Java EE in GlassFish
OSGi & Java EE in GlassFish
 
An Open Source OSGi Plug-In for Eclipse - Mikaël Desertot, University of Gre...
An Open Source OSGi Plug-In for Eclipse - Mikaël Desertot, University of Gre...An Open Source OSGi Plug-In for Eclipse - Mikaël Desertot, University of Gre...
An Open Source OSGi Plug-In for Eclipse - Mikaël Desertot, University of Gre...
 
Intro To OSGi
Intro To OSGiIntro To OSGi
Intro To OSGi
 
Introduction to OSGGi
Introduction to OSGGiIntroduction to OSGGi
Introduction to OSGGi
 
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
 
Eclipse + Maven + OSGi has never been so easy - Atllia Kiss
Eclipse + Maven + OSGi has never been so easy - Atllia KissEclipse + Maven + OSGi has never been so easy - Atllia Kiss
Eclipse + Maven + OSGi has never been so easy - Atllia Kiss
 
OWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA Testers
 
What's new in Gradle 4.0
What's new in Gradle 4.0What's new in Gradle 4.0
What's new in Gradle 4.0
 
Golang @ Tokopedia
Golang @ TokopediaGolang @ Tokopedia
Golang @ Tokopedia
 
CQ Maven Methods
CQ Maven MethodsCQ Maven Methods
CQ Maven Methods
 
CQCON CQ Maven Methods
CQCON CQ Maven MethodsCQCON CQ Maven Methods
CQCON CQ Maven Methods
 
Build content centric apps with eclipse and nuxeo - ny java-sig november 2011
Build content centric apps with eclipse and nuxeo - ny java-sig november 2011Build content centric apps with eclipse and nuxeo - ny java-sig november 2011
Build content centric apps with eclipse and nuxeo - ny java-sig november 2011
 
Osgi
OsgiOsgi
Osgi
 

More from mfrancis

Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
mfrancis
 
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
mfrancis
 
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
mfrancis
 
Visualization of OSGi based Software Architectures in Virtual Reality - Lisa ...
Visualization of OSGi based Software Architectures in Virtual Reality - Lisa ...Visualization of OSGi based Software Architectures in Virtual Reality - Lisa ...
Visualization of OSGi based Software Architectures in Virtual Reality - Lisa ...
mfrancis
 

More from mfrancis (20)

Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
 
OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)
 
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
 
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank LyaruuOSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
 
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
 
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
 
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
 
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
 
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
 
OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)
 
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
 
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
 
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
 
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
 
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
 
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
 
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
 
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
 
How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)
 
Visualization of OSGi based Software Architectures in Virtual Reality - Lisa ...
Visualization of OSGi based Software Architectures in Virtual Reality - Lisa ...Visualization of OSGi based Software Architectures in Virtual Reality - Lisa ...
Visualization of OSGi based Software Architectures in Virtual Reality - Lisa ...
 

Recently uploaded

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cf
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern Enterprise
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

Maven tools - Stuart McCulloch, V.P. OSGi, Jayway Malaysia

  • 1. Maven tools for OSGi Stuart McCulloch, V.P. OSGi Jayway Malaysia Technical Sessions - Short Talks June 27, 2007 - 11:10AM
  • 2. 2Jayway Malaysia Maven tools for OSGi • Goal • Introduce Maven tools to help you get started with OSGi. • No time to cover all OSGi tooling – there is a wide variety. • Industry Benefits • Gradual learning curve – concentrate on code not build. • Good integration with popular Java IDEs (Eclipse, IDEA).
  • 3. 3Jayway Malaysia Maven • Tool for building & managing Java projects • Project Object Model (pom.xml)‫‏‬ • well-defined build life-cycle • extensible plugin system • Supports remote and local repositories • dynamically fetch plugins / dependencies • Build artifacts have unique identifiers • groupId, artifactId, version
  • 4. 4Jayway Malaysia Bnd tool • Create OSGi bundle from • classpath (jars, class folders)‫‏‬ • simple instructions • Uses Pull approach • contents defined by instructions • generates OSGi metadata for you
  • 5. 5Jayway Malaysia Bnd tool (continued)‫‏‬ • Can be used as • command-line tool • ant task • maven plugin • eclipse plugin
  • 6. 6Jayway Malaysia maven-bundle-plugin • New packaging type: bundle • uses Bnd tool to create the OSGi artifact • default instructions from Maven project • can be configured further in pom.xml • Simple migration for existing projects • change packaging from jar to bundle
  • 7. 7Jayway Malaysia Pax Construct • Templates to kick-start development • project / bundles / common techniques • Simple scripts (Windows and *nix)‫‏‬ • Maven pax plugin • manages project build files • Eclipse support (extends maven-eclipse-plugin)‫‏‬ • OSGi provisioning (Equinox, Knopflerfish, Felix)‫‏‬
  • 8. 8Jayway Malaysia Example – starting a new project pax-create-project -g com.example -a osgi-test osgi-test __poms __compiled __imported __wrappers
  • 9. 9Jayway Malaysia Example – create an OSGi bundle pax-create-bundle -p com.example.client -n simple-test-client osgi-test __poms __simple-test-client __src (template code) __target (build output)‫‏‬
  • 10. 10Jayway Malaysia Example – wrap jar as OSGi bundle pax-wrap-jar -g net.sf.kxml -a kxml2 -v 2.2.2 osgi-test __poms __simple-test-client __net.sf.kxml.kxml2
  • 11. 11Jayway Malaysia Example – import an OSGi bundle pax-import-bundle -g org.ops4j.guice-osgi -a org.ops4j.guice-osgi.core -v 0.1.0-SNAPSHOT osgi-test __poms __simple-test-client __net.sf.kxml.kxml2 __org.ops4j.guice-osgi.core
  • 12. 12Jayway Malaysia Example – embed jar inside bundle pax-embed-jar -g net.sf.kxml -a kxml2 -v 2.2.2 Include-Resource: target/kxml2.jar=target/kxml2.jar Bundle-ClassPath:.,target/kxml2.jar • Also supports unpacking of jars inside bundles • benefit: can compile against the bundle • downside: lose encapsulation / separation
  • 13. 13Jayway Malaysia Example – unpacking a jar pax-embed-jar -g aopalliance -a aopalliance -v 1.0 -- -Dunpack=true Include-Resource: @target/aopalliance.jar, target/aopalliance.jar=_placeholder_.jar Bundle-ClassPath:.,target/aopalliance.jar • note: additional entries are there to satisfy Eclipse PDE
  • 14. 14Jayway Malaysia Example – build and provision mvn clean install pax:provision ______ ________ __ __ / __ / / __ / / / / / / ___/ / __ / _ _/ / / / / / / / _ /__/ /__/ /__/ /_/ /_/ Pax Runner from OPS4J - http://www.ops4j.org -------------------------------------------- Working Dir: /home/stuart/Code/ops4j/lab/guice-osgi/target/runner/work Starting: org.ops4j.guice-osgi, runner, 0.1.0-SNAPSHOT Name: Guice-OSGi Description: Lab project investigating using Guice to inject OSGi services Starting: org.ops4j.guice-osgi, runner, 0.1.0-SNAPSHOT Platform: equinox osgi>
  • 15. 15Jayway Malaysia Example – import to Eclipse PDE
  • 16. 16Jayway Malaysia Summary • Maven • flexible build system for Java • Bnd tool • create and verify OSGi bundles • Pax Construct • quick way to start OSGi projects There are many more tools for OSGi...
  • 17. 17Jayway Malaysia Resources • Maven • http://maven.apache.org • Bnd tool • http://www.aqute.biz/Code/Bnd • maven-bundle-plugin • http://cwiki.apache.org/FELIX/maven-bundle-plugin-bnd.html • Pax Construct • http://wiki.ops4j.org/confluence/display/ops4j/Pax+Construct