Building Composites
Overview
This page describes how to build your own Newton composite bundles. You can use a number of tools to build Composite bundles including: Sigil, Maven, and BND.
A composite bundle is just like an ordinary OSGi bundle but it includes SCA files to describe the components, and services that can be created using the bundle. It may or may not include an activator. If an activator is present it will be called prior to any composites being instantiated.
In order to make a bundle into a composite bundle simply add your SCA documents into the bundle in the directory META-INF/paremus/*.composite.
The following examples generate a bundle with: symbolic name mybundle; a single composite my.composite; classes from either the src directory or the com.my.company.* package (as appropriate); and an import for the com.example.api package.
Sigil
-bundles: mybundle
-sourcedirs: src
-imports: com.example.api
-composites: xml/my.composite
BND
Bundle-SymbolicName: mybundle
Private-Package com.my.company.*
Import-Package: com.example.api
Include-Resource: META-INF/paremus/my.composite=xml/my.composite
Maven
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>mybundle</artifactId>
<packaging>bundle</packaging>
<version>1.0</version>
<name>Example Bundle</name>
<dependencies>
<dependency>
<groupId>com.example</groupId>
<artifactId>com.example.api</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Private-Package>com.my.company.*</Private-Package>
<Import-Package>com.example.api</Import-Package>
<Include-Resource>META-INF/paremus/my.composite=xml/my.composite</ Include-Resource>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>


