The OSGi Distribution plugin is used to package OSGi applications using Maven. Basically, it just copy all dependencies in specified folders, copy the provided resources and zip the result. It also supports multiple inheritance between distributions. These distributions come as zip files, and can be fine tuned to have dependencies come in separate folders, with different names.
The full documentation is available on :
- http://adeleresearchgroup.github.io/osgi-distribution-plugin/release/ for the latest release
- http://adeleresearchgroup.github.io/osgi-distribution-plugin/snapshot/ for the development version
The plugin is licensed under the Apache Software License 2.0.
An output configuration example :
<outputs>
<output>
<IncludesArtifactId>org.apache.felix.main</IncludesArtifactId>
<directory>bin</directory>
<outputFileName>felix.jar</outputFileName>
</output>
<output>
<IncludesArtifactId>org.apache.felix.fileinstall</IncludesArtifactId>
<directory>bundles</directory>
</output>
</outputs>Results in the following :
- The felix dependency will be redirected to the "bin" directory, and will be renamed to "felix.jar".
- The fileinstall dependency will be redirected to the "bundles" directory.
- All other dependencies go to the "load" folder (default behavior).
Projects using this plugin need to use the "osgi-distribution" packaging type, and call the plugin in their plugins section.
<build>
<plugins>
<plugin>
<groupId>fr.liglab.adele.common</groupId>
<artifactId>maven-osgi-distribution-plugin</artifactId>
<version>@project.version@</version>
<extensions>true</extensions>
<configuration>
<defaultOutputDirectory>bundle</defaultOutputDirectory>
<generateScripts>true</generateScripts>
<outputs>
...
</outputs>
</configuration>
</plugin>
</plugins>
</build>To run the plugin, just call the "install" goal on your project.
Plugin configuration options
defaultOutputDirectoryto specifiy the location of the artifacts declared in the dependency section. Except for artifacts defined in theoutputssection. Default valueload.generateScriptsto generate launcher temporal scripts (useful while testing distribution) Default valuefalse.flattenDPto specify if Deployment-Packages dependencies will be flatten in the distribution or not. Default valuefalse.outputsused to configure target location for some artifacts.outputthe entry to define the desired artifact.IncludesArtifactIdthe artifactId.directorythe target directory location of the current artifact.outputFileNameif defined, the artifact filename will be overrided by this value.