SlideShare a Scribd company logo
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
?

More Related Content

What's hot

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
Nuxeo
 
Dockerizing your java development environment
Dockerizing your java development environmentDockerizing your java development environment
Dockerizing your java development environment
Buhake Sindi
 
Apereo OAE development and release process
Apereo OAE development and release processApereo OAE development and release process
Apereo OAE development and release process
Bert 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 Developers
Xavier 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 cloud
Jacek 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 Atomic
Michael Solberg
 
Selenium cloud
Selenium cloudSelenium cloud
Selenium cloud
itkosmopolit
 
Apache Maven
Apache MavenApache Maven
Apache Maven
eurosigdoc acm
 
Developing NuGet
Developing NuGetDeveloping NuGet
Developing NuGet
Jeff Handley
 
Continuous testing
Continuous testingContinuous testing
Continuous testing
Oleksandr Metelytsia
 
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
Swaminathan Vetri
 
Better delivery with DevOps Driven Development
Better delivery with DevOps Driven DevelopmentBetter delivery with DevOps Driven Development
Better delivery with DevOps Driven Development
Jirayut Nimsaeng
 
Nuxeo and JavaScript
Nuxeo and JavaScriptNuxeo and JavaScript
Nuxeo and JavaScript
Nuxeo
 
ElasTest Webinar
ElasTest WebinarElasTest Webinar
ElasTest Webinar
ElasTest Project
 
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
OpenCms
 
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.0
Sriram Narayanan
 
Wonderful World of Maven
Wonderful World of MavenWonderful World of Maven
Wonderful World of Maven
Justin 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 Domino
Frank van der Linden
 
Understanding NuGet implementation for Enterprises
Understanding NuGet implementation for EnterprisesUnderstanding NuGet implementation for Enterprises
Understanding NuGet implementation for Enterprises
J S Jodha
 

What's hot (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 to 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
 
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
Guilherme Pereira Silva
 
Functest in Depth
Functest in DepthFunctest in Depth
Functest in Depth
OPNFV
 
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 Manager
DMC, Inc.
 
Spring Native and Spring AOT
Spring Native and Spring AOTSpring Native and Spring AOT
Spring Native and Spring AOT
VMware Tanzu
 
Octopus Deploy Tech Fest 2014
Octopus Deploy Tech Fest 2014Octopus Deploy Tech Fest 2014
Octopus Deploy Tech Fest 2014
adriantwright
 
GlassFish OSGi - Java2days 2010
GlassFish OSGi - Java2days 2010GlassFish OSGi - Java2days 2010
GlassFish OSGi - Java2days 2010
Alexis Moussine-Pouchkine
 
Learn OpenStack from trystack.cn
Learn OpenStack from trystack.cnLearn OpenStack from trystack.cn
Learn OpenStack from trystack.cn
OpenCity Community
 
Webinar: OpenStack Accelerates Software Development
Webinar: OpenStack Accelerates Software DevelopmentWebinar: OpenStack Accelerates Software Development
Webinar: OpenStack Accelerates Software Development
Platform9
 
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 Automatization
Sergey Arkhipov
 
OTN Developer Days - GlassFish
OTN Developer Days - GlassFishOTN Developer Days - GlassFish
OTN Developer Days - GlassFish
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
AnkitaJaggi1
 
The State of the Veil Framework
The State of the Veil FrameworkThe State of the Veil Framework
The State of the Veil Framework
VeilFramework
 
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 Controller
Sumit 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 ones
Allon 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 Stack
Josef Karásek
 
OpenStack Rally presentation by RamaK
OpenStack Rally presentation by RamaKOpenStack Rally presentation by RamaK
OpenStack Rally presentation by RamaK
Rama Krishna B
 

Similar to 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
 

More from 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 Lyaruu
mfrancis
 
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
 

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

Recently uploaded

Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
Pravash Chandra Das
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
Dinusha Kumarasiri
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
Hiike
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
flufftailshop
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 

Recently uploaded (20)

Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 

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!