SlideShare una empresa de Scribd logo
1 de 21
Descargar para leer sin conexión
public2015-11-04
•
1
•
OSGi from the Trenches
Painless Server Side Development
Date: 2015-11-04
Location: OSGi Community Event / EclipseCon 2015, Ludwigsburg, Germany
Speakers: Magnus Jungsbluth, Domagoj Cosic
public2015-11-04 2
What we do
▪ Platform development for products and in-house
projects, server side
▪ Plain OSGi – no Eclipse RCP
public2015-11-04 3
Integrating…
Eclipse: Equinox, EclipseLink, Jetty, Gemini (JPA, Blueprint,
Naming)
Apache: CXF, ActiveMQ, Camel, Felix, ServiceMix Bundles
Spring: Core, MVC, Data, Security, Shell
Diverse: Vaadin, QueryDSL, Camunda BPM...
public2015-11-04 4
Pain?
▪ Bad OSGi metadata
▪ Missing Import-Package,
▪ version range does not match 

documented compatibility,
▪ missing resolution:=optional
▪ Implicit assumptions on Start Levels
▪ Differences between Test, Deployment and
Development
public2015-11-04 5
What does it feel like?
public2015-11-04 6
Create your own Launcher!
FrameworkFactory frameworkFactory =

ServiceLoader.load(FrameworkFactory.class).iterator().next();
Framework framework = frameworkFactory.newFramework(Collections.emtpyMap());
framework.start();
[1] http://njbartlett.name/2011/07/03/embedding-osgi.html
public2015-11-04 7
OsgiContainerConfiguration config = new DefaultOsgiContainerConfiguration();
…
framework.init();
for (BundleMetaData bundleMeta : config.getBundlesToInstall()) {
Bundle bundle = framework.getBundleContext()
.installBundle(“reference:” + bundleMeta.getLocation());
applyStartLevel(bundle, config.getStartLevelToApply(bundleMeta));
bundle.start();
}
framework.start();
In-code configuration
… aka "beware of another XML format"
public2015-11-04 8
Startlevelspublic class DefaultOsgiContainerConfiguration implements OsgiContainerConfiguration {
public DefaultOsgiContainerConfiguration() {
withDefaultStartLevel("org.apache.cxf.*", 9);
withDefaultStartLevel("javax.persistence", 4);
}
@Override
public void withDefaultStartLevel(String pattern, int level) {
defaultStartLevels.put(
Pattern.compile(pattern.replace(".", ".").replace("*", ".*")), level);
}
@Override
public Integer getStartLevelToApply(BundleMetaData bundleMeta) {
Integer startLevel = null;
for (Entry<Pattern, Integer> entry : defaultStartLevels.entrySet()) {
if (entry.getKey().matcher(bundleMeta.getBundleSymbolicName()).matches()) {
startLevel = entry.getValue();
}
}
return startLevel;
}
}
! uniform behavior throughout different applications on the same
platform
public2015-11-04 9
Which Bundles to install?
Maven
▪ create one pom.xml for each deployment to define application‘s bundles
▪ Custom Maven Plugin starts the framework with runtime+compile
(transitive!) dependencies from that pom.xml
JUnit
▪ Start all OSGi Bundles that are on the Classpath

(TCCL.getResources("/META-INF/MANIFEST.MF"))
▪ ! Either IDE or Maven will provide the dependencies on the class path of the
JUnit launcher
Deployment (launcher.jar)
▪ Scan bin/bundles and install all .jars from that directory
public2015-11-04 10
How about the IDE?
Launch / Debug
Just run mvn rt:launch
! no plugin necessary
Test
Just run the JUnit test as you always do
! no plugin necessary
public2015-11-04 11
Demo
public2015-11-04 12
JUnit integration
▪ Analogous to the SuiteRunner, create an OsgiTestSuite that is responsible
for setting up the container and SuiteClasses to define the actual test classes



! still have the @RunWith annotation at your free disposal
▪ Use Boot Delegation to delegate all test libraries (org.junit.*,
org.mockito.*, ...)
▪ No special bundle configuration necessary (tradeoff flexibility), aimed at integration
tests with fixed set of bundles
public2015-11-04 13
Example
@RunWith(OsgiTestSuite.class)
@SuiteClasses(MyITCase.class)
public class MyIT {}
//No RunWith annotation necessary
public class MyITCase {
@Test
public void shouldDoFoobar() {
}
}
public2015-11-04 14
public2015-11-04 15
Bundle creation (Maven)
mvn process-classes: 

create target/classes/META-INF/MANIFEST.MF using maven-bundle-
plugin:manifest
mvn package: 

create .jar using maven-jar-plugin (Ordinary “jar“ packaging>)
!Simple, standard Maven setup that does not deviate much from non-OSGi builds.
public2015-11-04 16
Bundle creation (Eclipse)
m2e “Tycho Project Configurators“ configures affected
projects to rebuild MANIFEST.MF on each incremental
build (equivalent to process-classes in Maven)
à target/classes is always a valid bundle
! perfectly fits Eclipse IDE's incremental build philosophy
public2015-11-04 17
How to tackle bad OSGi Metadata?
"traditional" approach
▪ Open the .jar with the tool of your choice and fiddle with
the MANIFEST.MF until your test is green.
▪ Create a patch version and deploy it to your local repository
(Nexus / Artifactory).
▪ Maintain this patch for a while (a.k.a ,"Rip your hair out")
public2015-11-04 18


Fix Metadata at Runtime
▪ Use a Java DSL to describe the difference:
bundles("org.apache.cxf.*")

.having(Constants.IMPORT_PACKAGE)

.matching("org.springframework.beans.*")

.widenUpperVersionRange("5");
bundles("org.apache.cxf.*")

.having(Constants.IMPORT_PACKAGE)

.matching("org.springframework.beans.*")

.ensureDirective("resolution", "optional");
▪ add it to the default configuration of you launcher
▪ continue with what you were originally doing ("relax")
public2015-11-04 19
Last but not Least
Open an issue with the library‘s owner, document
which headers must be changed:
! Exactly the same information you just defined using
the DSL!
public2015-11-04 20
public2015-11-04 21
Questions
?

Más contenido relacionado

La actualidad más candente

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 MarketplaceNuxeo
 
Dockerizing your java development environment
Dockerizing your java development environmentDockerizing your java development environment
Dockerizing your java development environmentBuhake Sindi
 
Apereo OAE development and release process
Apereo OAE development and release processApereo OAE development and release process
Apereo OAE development and release processBert Pareyn
 
EclipseCon Europe 2016 - Docker Tooling for Developers
EclipseCon Europe 2016 - Docker Tooling for DevelopersEclipseCon Europe 2016 - Docker Tooling for Developers
EclipseCon Europe 2016 - Docker Tooling for DevelopersXavier Coulon
 
Bgoug 2019.11 building free, open-source, plsql products in cloud
Bgoug 2019.11   building free, open-source, plsql products in cloudBgoug 2019.11   building free, open-source, plsql products in cloud
Bgoug 2019.11 building free, open-source, plsql products in cloudJacek Gebal
 
Streamlining Agile Linux Development with Docker and RHEL Atomic
Streamlining Agile Linux Development with Docker and RHEL AtomicStreamlining Agile Linux Development with Docker and RHEL Atomic
Streamlining Agile Linux Development with Docker and RHEL AtomicMichael Solberg
 
Cross platform dotnet development using dotnet core
Cross platform dotnet development using dotnet coreCross platform dotnet development using dotnet core
Cross platform dotnet development using dotnet coreSwaminathan Vetri
 
Better delivery with DevOps Driven Development
Better delivery with DevOps Driven DevelopmentBetter delivery with DevOps Driven Development
Better delivery with DevOps Driven DevelopmentJirayut Nimsaeng
 
Nuxeo and JavaScript
Nuxeo and JavaScriptNuxeo and JavaScript
Nuxeo and JavaScriptNuxeo
 
OpenCms Days 2015: Keynote - OpenCms 10 X marks the spot
OpenCms Days 2015: Keynote - OpenCms 10 X marks the spotOpenCms Days 2015: Keynote - OpenCms 10 X marks the spot
OpenCms Days 2015: Keynote - OpenCms 10 X marks the spotOpenCms
 
Continuous Delivery: 5 years later (Incontro DevOps 2018)
Continuous Delivery: 5 years later (Incontro DevOps 2018)Continuous Delivery: 5 years later (Incontro DevOps 2018)
Continuous Delivery: 5 years later (Incontro DevOps 2018)Giovanni Toraldo
 
Continuous integration for open source distros v 3.0
Continuous integration for open source distros v 3.0Continuous integration for open source distros v 3.0
Continuous integration for open source distros v 3.0Sriram Narayanan
 
Wonderful World of Maven
Wonderful World of MavenWonderful World of Maven
Wonderful World of MavenJustin J. Moses
 
An XPager's Guide to Process Server-Side Jobs on Domino
An XPager's Guide to Process Server-Side Jobs on DominoAn XPager's Guide to Process Server-Side Jobs on Domino
An XPager's Guide to Process Server-Side Jobs on DominoFrank van der Linden
 
Understanding NuGet implementation for Enterprises
Understanding NuGet implementation for EnterprisesUnderstanding NuGet implementation for Enterprises
Understanding NuGet implementation for EnterprisesJ S Jodha
 

La actualidad más candente (20)

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
 
Dockerizing your java development environment
Dockerizing your java development environmentDockerizing your java development environment
Dockerizing your java development environment
 
Apereo OAE development and release process
Apereo OAE development and release processApereo OAE development and release process
Apereo OAE development and release process
 
EclipseCon Europe 2016 - Docker Tooling for Developers
EclipseCon Europe 2016 - Docker Tooling for DevelopersEclipseCon Europe 2016 - Docker Tooling for Developers
EclipseCon Europe 2016 - Docker Tooling for Developers
 
Bgoug 2019.11 building free, open-source, plsql products in cloud
Bgoug 2019.11   building free, open-source, plsql products in cloudBgoug 2019.11   building free, open-source, plsql products in cloud
Bgoug 2019.11 building free, open-source, plsql products in cloud
 
Streamlining Agile Linux Development with Docker and RHEL Atomic
Streamlining Agile Linux Development with Docker and RHEL AtomicStreamlining Agile Linux Development with Docker and RHEL Atomic
Streamlining Agile Linux Development with Docker and RHEL Atomic
 
Selenium cloud
Selenium cloudSelenium cloud
Selenium cloud
 
Apache Maven
Apache MavenApache Maven
Apache Maven
 
Developing NuGet
Developing NuGetDeveloping NuGet
Developing NuGet
 
Continuous testing
Continuous testingContinuous testing
Continuous testing
 
Cross platform dotnet development using dotnet core
Cross platform dotnet development using dotnet coreCross platform dotnet development using dotnet core
Cross platform dotnet development using dotnet core
 
Better delivery with DevOps Driven Development
Better delivery with DevOps Driven DevelopmentBetter delivery with DevOps Driven Development
Better delivery with DevOps Driven Development
 
Nuxeo and JavaScript
Nuxeo and JavaScriptNuxeo and JavaScript
Nuxeo and JavaScript
 
ElasTest Webinar
ElasTest WebinarElasTest Webinar
ElasTest Webinar
 
OpenCms Days 2015: Keynote - OpenCms 10 X marks the spot
OpenCms Days 2015: Keynote - OpenCms 10 X marks the spotOpenCms Days 2015: Keynote - OpenCms 10 X marks the spot
OpenCms Days 2015: Keynote - OpenCms 10 X marks the spot
 
Continuous Delivery: 5 years later (Incontro DevOps 2018)
Continuous Delivery: 5 years later (Incontro DevOps 2018)Continuous Delivery: 5 years later (Incontro DevOps 2018)
Continuous Delivery: 5 years later (Incontro DevOps 2018)
 
Continuous integration for open source distros v 3.0
Continuous integration for open source distros v 3.0Continuous integration for open source distros v 3.0
Continuous integration for open source distros v 3.0
 
Wonderful World of Maven
Wonderful World of MavenWonderful World of Maven
Wonderful World of Maven
 
An XPager's Guide to Process Server-Side Jobs on Domino
An XPager's Guide to Process Server-Side Jobs on DominoAn XPager's Guide to Process Server-Side Jobs on Domino
An XPager's Guide to Process Server-Side Jobs on Domino
 
Understanding NuGet implementation for Enterprises
Understanding NuGet implementation for EnterprisesUnderstanding NuGet implementation for Enterprises
Understanding NuGet implementation for Enterprises
 

Similar a OSGi from the Trenches- Painless Server Side Development - Magnus Jungsbluth & Domagoj Cosic

SFO15-TR6: Server Ecosystem Day (Part 6A)
SFO15-TR6: Server Ecosystem Day (Part 6A) SFO15-TR6: Server Ecosystem Day (Part 6A)
SFO15-TR6: Server Ecosystem Day (Part 6A) Linaro
 
Functest in Depth
Functest in DepthFunctest in Depth
Functest in DepthOPNFV
 
microXchg 2019: "Creating an Effective Developer Experience for Cloud-Native ...
microXchg 2019: "Creating an Effective Developer Experience for Cloud-Native ...microXchg 2019: "Creating an Effective Developer Experience for Cloud-Native ...
microXchg 2019: "Creating an Effective Developer Experience for Cloud-Native ...Daniel Bryant
 
NI Package Manager
NI Package ManagerNI Package Manager
NI Package ManagerDMC, Inc.
 
Spring Native and Spring AOT
Spring Native and Spring AOTSpring Native and Spring AOT
Spring Native and Spring AOTVMware Tanzu
 
Octopus Deploy Tech Fest 2014
Octopus Deploy Tech Fest 2014Octopus Deploy Tech Fest 2014
Octopus Deploy Tech Fest 2014adriantwright
 
Learn OpenStack from trystack.cn
Learn OpenStack from trystack.cnLearn OpenStack from trystack.cn
Learn OpenStack from trystack.cnOpenCity Community
 
Webinar: OpenStack Accelerates Software Development
Webinar: OpenStack Accelerates Software DevelopmentWebinar: OpenStack Accelerates Software Development
Webinar: OpenStack Accelerates Software DevelopmentPlatform9
 
Hadoop: Big Data Stacks validation w/ iTest How to tame the elephant?
Hadoop:  Big Data Stacks validation w/ iTest  How to tame the elephant?Hadoop:  Big Data Stacks validation w/ iTest  How to tame the elephant?
Hadoop: Big Data Stacks validation w/ iTest How to tame the elephant?Dmitri Shiryaev
 
Kirill Rozin - Practical Wars for Automatization
Kirill Rozin - Practical Wars for AutomatizationKirill Rozin - Practical Wars for Automatization
Kirill Rozin - Practical Wars for AutomatizationSergey Arkhipov
 
OTN Developer Days - GlassFish
OTN Developer Days - GlassFishOTN Developer Days - GlassFish
OTN Developer Days - GlassFishglassfish
 
Bhopal mule soft_meetup_17july2021_azuredevopsintegration_mulesoft
Bhopal mule soft_meetup_17july2021_azuredevopsintegration_mulesoftBhopal mule soft_meetup_17july2021_azuredevopsintegration_mulesoft
Bhopal mule soft_meetup_17july2021_azuredevopsintegration_mulesoftAnkitaJaggi1
 
The State of the Veil Framework
The State of the Veil FrameworkThe State of the Veil Framework
The State of the Veil FrameworkVeilFramework
 
Throwing complexity over the wall: Rapid development for enterprise Java (Jav...
Throwing complexity over the wall: Rapid development for enterprise Java (Jav...Throwing complexity over the wall: Rapid development for enterprise Java (Jav...
Throwing complexity over the wall: Rapid development for enterprise Java (Jav...Dan Allen
 
Opendaylight SDN Controller
Opendaylight SDN ControllerOpendaylight SDN Controller
Opendaylight SDN ControllerSumit Arora
 
Step by Step - Reusing old features to build new ones
Step by Step - Reusing old features to build new onesStep by Step - Reusing old features to build new ones
Step by Step - Reusing old features to build new onesAllon Mureinik
 
Logs/Metrics Gathering With OpenShift EFK Stack
Logs/Metrics Gathering With OpenShift EFK StackLogs/Metrics Gathering With OpenShift EFK Stack
Logs/Metrics Gathering With OpenShift EFK StackJosef Karásek
 
OpenStack Rally presentation by RamaK
OpenStack Rally presentation by RamaKOpenStack Rally presentation by RamaK
OpenStack Rally presentation by RamaKRama Krishna B
 

Similar a OSGi from the Trenches- Painless Server Side Development - Magnus Jungsbluth & Domagoj Cosic (20)

SFO15-TR6: Server Ecosystem Day (Part 6A)
SFO15-TR6: Server Ecosystem Day (Part 6A) SFO15-TR6: Server Ecosystem Day (Part 6A)
SFO15-TR6: Server Ecosystem Day (Part 6A)
 
Building APIs with Mule and Spring Boot
Building APIs with Mule and Spring BootBuilding APIs with Mule and Spring Boot
Building APIs with Mule and Spring Boot
 
Functest in Depth
Functest in DepthFunctest in Depth
Functest in Depth
 
microXchg 2019: "Creating an Effective Developer Experience for Cloud-Native ...
microXchg 2019: "Creating an Effective Developer Experience for Cloud-Native ...microXchg 2019: "Creating an Effective Developer Experience for Cloud-Native ...
microXchg 2019: "Creating an Effective Developer Experience for Cloud-Native ...
 
NI Package Manager
NI Package ManagerNI Package Manager
NI Package Manager
 
Spring Native and Spring AOT
Spring Native and Spring AOTSpring Native and Spring AOT
Spring Native and Spring AOT
 
Octopus Deploy Tech Fest 2014
Octopus Deploy Tech Fest 2014Octopus Deploy Tech Fest 2014
Octopus Deploy Tech Fest 2014
 
GlassFish OSGi - Java2days 2010
GlassFish OSGi - Java2days 2010GlassFish OSGi - Java2days 2010
GlassFish OSGi - Java2days 2010
 
Learn OpenStack from trystack.cn
Learn OpenStack from trystack.cnLearn OpenStack from trystack.cn
Learn OpenStack from trystack.cn
 
Webinar: OpenStack Accelerates Software Development
Webinar: OpenStack Accelerates Software DevelopmentWebinar: OpenStack Accelerates Software Development
Webinar: OpenStack Accelerates Software Development
 
Hadoop: Big Data Stacks validation w/ iTest How to tame the elephant?
Hadoop:  Big Data Stacks validation w/ iTest  How to tame the elephant?Hadoop:  Big Data Stacks validation w/ iTest  How to tame the elephant?
Hadoop: Big Data Stacks validation w/ iTest How to tame the elephant?
 
Kirill Rozin - Practical Wars for Automatization
Kirill Rozin - Practical Wars for AutomatizationKirill Rozin - Practical Wars for Automatization
Kirill Rozin - Practical Wars for Automatization
 
OTN Developer Days - GlassFish
OTN Developer Days - GlassFishOTN Developer Days - GlassFish
OTN Developer Days - GlassFish
 
Bhopal mule soft_meetup_17july2021_azuredevopsintegration_mulesoft
Bhopal mule soft_meetup_17july2021_azuredevopsintegration_mulesoftBhopal mule soft_meetup_17july2021_azuredevopsintegration_mulesoft
Bhopal mule soft_meetup_17july2021_azuredevopsintegration_mulesoft
 
The State of the Veil Framework
The State of the Veil FrameworkThe State of the Veil Framework
The State of the Veil Framework
 
Throwing complexity over the wall: Rapid development for enterprise Java (Jav...
Throwing complexity over the wall: Rapid development for enterprise Java (Jav...Throwing complexity over the wall: Rapid development for enterprise Java (Jav...
Throwing complexity over the wall: Rapid development for enterprise Java (Jav...
 
Opendaylight SDN Controller
Opendaylight SDN ControllerOpendaylight SDN Controller
Opendaylight SDN Controller
 
Step by Step - Reusing old features to build new ones
Step by Step - Reusing old features to build new onesStep by Step - Reusing old features to build new ones
Step by Step - Reusing old features to build new ones
 
Logs/Metrics Gathering With OpenShift EFK Stack
Logs/Metrics Gathering With OpenShift EFK StackLogs/Metrics Gathering With OpenShift EFK Stack
Logs/Metrics Gathering With OpenShift EFK Stack
 
OpenStack Rally presentation by RamaK
OpenStack Rally presentation by RamaKOpenStack Rally presentation by RamaK
OpenStack Rally presentation by RamaK
 

Más de mfrancis

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...mfrancis
 
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)mfrancis
 
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)mfrancis
 
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 Lyaruumfrancis
 
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...mfrancis
 
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...mfrancis
 
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...mfrancis
 
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)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
 
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)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
 
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
 
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...mfrancis
 
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)mfrancis
 
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)mfrancis
 
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)mfrancis
 
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...mfrancis
 
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)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
 
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)mfrancis
 

Más de 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...
 
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...
 
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)
 

Último

Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 

Último (20)

Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 

OSGi from the Trenches- Painless Server Side Development - Magnus Jungsbluth & Domagoj Cosic

  • 1. public2015-11-04 • 1 • OSGi from the Trenches Painless Server Side Development Date: 2015-11-04 Location: OSGi Community Event / EclipseCon 2015, Ludwigsburg, Germany Speakers: Magnus Jungsbluth, Domagoj Cosic
  • 2. public2015-11-04 2 What we do ▪ Platform development for products and in-house projects, server side ▪ Plain OSGi – no Eclipse RCP
  • 3. public2015-11-04 3 Integrating… Eclipse: Equinox, EclipseLink, Jetty, Gemini (JPA, Blueprint, Naming) Apache: CXF, ActiveMQ, Camel, Felix, ServiceMix Bundles Spring: Core, MVC, Data, Security, Shell Diverse: Vaadin, QueryDSL, Camunda BPM...
  • 4. public2015-11-04 4 Pain? ▪ Bad OSGi metadata ▪ Missing Import-Package, ▪ version range does not match 
 documented compatibility, ▪ missing resolution:=optional ▪ Implicit assumptions on Start Levels ▪ Differences between Test, Deployment and Development
  • 6. public2015-11-04 6 Create your own Launcher! FrameworkFactory frameworkFactory =
 ServiceLoader.load(FrameworkFactory.class).iterator().next(); Framework framework = frameworkFactory.newFramework(Collections.emtpyMap()); framework.start(); [1] http://njbartlett.name/2011/07/03/embedding-osgi.html
  • 7. public2015-11-04 7 OsgiContainerConfiguration config = new DefaultOsgiContainerConfiguration(); … framework.init(); for (BundleMetaData bundleMeta : config.getBundlesToInstall()) { Bundle bundle = framework.getBundleContext() .installBundle(“reference:” + bundleMeta.getLocation()); applyStartLevel(bundle, config.getStartLevelToApply(bundleMeta)); bundle.start(); } framework.start(); In-code configuration … aka "beware of another XML format"
  • 8. public2015-11-04 8 Startlevelspublic class DefaultOsgiContainerConfiguration implements OsgiContainerConfiguration { public DefaultOsgiContainerConfiguration() { withDefaultStartLevel("org.apache.cxf.*", 9); withDefaultStartLevel("javax.persistence", 4); } @Override public void withDefaultStartLevel(String pattern, int level) { defaultStartLevels.put( Pattern.compile(pattern.replace(".", ".").replace("*", ".*")), level); } @Override public Integer getStartLevelToApply(BundleMetaData bundleMeta) { Integer startLevel = null; for (Entry<Pattern, Integer> entry : defaultStartLevels.entrySet()) { if (entry.getKey().matcher(bundleMeta.getBundleSymbolicName()).matches()) { startLevel = entry.getValue(); } } return startLevel; } } ! uniform behavior throughout different applications on the same platform
  • 9. public2015-11-04 9 Which Bundles to install? Maven ▪ create one pom.xml for each deployment to define application‘s bundles ▪ Custom Maven Plugin starts the framework with runtime+compile (transitive!) dependencies from that pom.xml JUnit ▪ Start all OSGi Bundles that are on the Classpath
 (TCCL.getResources("/META-INF/MANIFEST.MF")) ▪ ! Either IDE or Maven will provide the dependencies on the class path of the JUnit launcher Deployment (launcher.jar) ▪ Scan bin/bundles and install all .jars from that directory
  • 10. public2015-11-04 10 How about the IDE? Launch / Debug Just run mvn rt:launch ! no plugin necessary Test Just run the JUnit test as you always do ! no plugin necessary
  • 12. public2015-11-04 12 JUnit integration ▪ Analogous to the SuiteRunner, create an OsgiTestSuite that is responsible for setting up the container and SuiteClasses to define the actual test classes
 
 ! still have the @RunWith annotation at your free disposal ▪ Use Boot Delegation to delegate all test libraries (org.junit.*, org.mockito.*, ...) ▪ No special bundle configuration necessary (tradeoff flexibility), aimed at integration tests with fixed set of bundles
  • 13. public2015-11-04 13 Example @RunWith(OsgiTestSuite.class) @SuiteClasses(MyITCase.class) public class MyIT {} //No RunWith annotation necessary public class MyITCase { @Test public void shouldDoFoobar() { } }
  • 15. public2015-11-04 15 Bundle creation (Maven) mvn process-classes: 
 create target/classes/META-INF/MANIFEST.MF using maven-bundle- plugin:manifest mvn package: 
 create .jar using maven-jar-plugin (Ordinary “jar“ packaging>) !Simple, standard Maven setup that does not deviate much from non-OSGi builds.
  • 16. public2015-11-04 16 Bundle creation (Eclipse) m2e “Tycho Project Configurators“ configures affected projects to rebuild MANIFEST.MF on each incremental build (equivalent to process-classes in Maven) à target/classes is always a valid bundle ! perfectly fits Eclipse IDE's incremental build philosophy
  • 17. public2015-11-04 17 How to tackle bad OSGi Metadata? "traditional" approach ▪ Open the .jar with the tool of your choice and fiddle with the MANIFEST.MF until your test is green. ▪ Create a patch version and deploy it to your local repository (Nexus / Artifactory). ▪ Maintain this patch for a while (a.k.a ,"Rip your hair out")
  • 18. public2015-11-04 18 
 Fix Metadata at Runtime ▪ Use a Java DSL to describe the difference: bundles("org.apache.cxf.*")
 .having(Constants.IMPORT_PACKAGE)
 .matching("org.springframework.beans.*")
 .widenUpperVersionRange("5"); bundles("org.apache.cxf.*")
 .having(Constants.IMPORT_PACKAGE)
 .matching("org.springframework.beans.*")
 .ensureDirective("resolution", "optional"); ▪ add it to the default configuration of you launcher ▪ continue with what you were originally doing ("relax")
  • 19. public2015-11-04 19 Last but not Least Open an issue with the library‘s owner, document which headers must be changed: ! Exactly the same information you just defined using the DSL!