| :doctype: book |
| |
| Title: EBAMavenPluginProject |
| |
| +++<a name="EBAMavenPluginProject-EBAMavenPlugin">++++++</a>+++ |
| |
| = EBA Maven Plugin |
| |
| The EBA Maven Plugin provides the ability to generate EBA archives using Maven. |
| The EBA archive format is described in link:applications.html[Applications] . An EBA archive can optionally contain an Application manifest (APPLICATION.MF). |
| This can be added in one of two ways |
| |
| . Hand written and added into the archive. |
| . Generated based on pom configuration. |
| |
| +++<a name="EBAMavenPluginProject-UsingthePlugin">++++++</a>+++ |
| |
| == Using the Plugin |
| |
| The plugin is included by as follows: |
| |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>org.apache.aries</groupId> |
| <artifactId>eba-maven-plugin</artifactId> |
| </plugin> |
| </plugins> |
| </build> |
| |
| By default it will not generate a manifest, so in the above example it will attempt to copy a pre-defined APPLICATION.MF from src/main/resources/META-INF. |
| If that file does not exist, then no application manifest will be included. |
| |
| +++<a name="EBAMavenPluginProject-GeneratinganAPPLICATION.MF">++++++</a>+++ |
| |
| == Generating an APPLICATION.MF |
| |
| The following example shows how to get the plugin to generate an APPLICATION.MF based on the pom configuration: |
| |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>org.apache.aries</groupId> |
| <artifactId>eba-maven-plugin</artifactId> |
| <configuration> |
| <generateManifest>true</generateManifest> |
| </configuration> |
| </plugin> |
| </plugins> |
| </build> |
| |
| The pom to application manfiest header mapping is as follows: |
| |
| * Pom +++<groupId>++++++</groupId>+++.+++<artifactId>++++++</artifactId>+++ \-> Application-SymbolicName |
| * Pom +++<name>++++++</name>+++ \-> Application-Name |
| * Pom +++<version>++++++</version>+++ \-> Application-Version (cleaned up for OSGi) |
| * Pom +++<description>++++++</description>+++ \-> Application-Description |
| * Pom +++<dependencies>++++++</dependencies>+++ \-> Application-Content |
| |
| +++<a name="EBAMavenPluginProject-OverridingApplication-SymbolicName">++++++</a>+++ |
| |
| == Overriding Application-SymbolicName |
| |
| The application symbolic name defaults to the ${project.groupId}.${project.artifaceId}. |
| The following shows how to override this: |
| |
| <configuration> |
| <instructions> |
| <Application-SymbolicName>${project.artifaceId}</Application-SymbolicName> |
| </instructions> |
| </configuration> |
| |
| +++<a name="EBAMavenPluginProject-AddingApplication-ExportServiceandApplication-ImportServiceheaders">++++++</a>+++ |
| |
| == Adding Application-ExportService and Application-ImportService headers |
| |
| The application import service and export service headers can be set as follows. |
| The text inside the elements is included as-is. |
| |
| <configuration> |
| <instructions> |
| <Application-ExportService>...</Application-ExportService> |
| <Application-ImportService>...</Application-ImportService> |
| </instructions> |
| </configuration> |
| |
| +++<a name="EBAMavenPluginProject-AddingUseBundleheader">++++++</a>+++ |
| |
| == Adding the Use-Bundle header |
| |
| The application Use-Bundle header can be set as follows. |
| The text inside the elements is included as-is. |
| |
| <configuration> |
| <instructions> |
| <Use-Bundle>...</Use-Bundle> |
| </instructions> |
| </configuration> |
| |
| +++<a name="EBAMavenPluginProject-Includingtransitivedependencies">++++++</a>+++ |
| |
| == Including transitive dependencies (deprecated) |
| |
| This configuration option is deprecated in favor of +++<archiveContent>++++++</archiveContent>+++. |
| |
| By default, the archive will only include the direct dependencies of the project. |
| Transitive dependencies can be includes as follows: |
| |
| <configuration> |
| <useTransitiveDependencies>true</useTransitiveDependencies> |
| </configuration> |
| |
| +++<a name="EBAMavenPluginProject-Archivecontent">++++++</a>+++ |
| |
| == Including bundles in the archive |
| |
| By default, the archive will only include the direct dependencies of the project. |
| The `<archiveContent/>` element can be used to control the archive artifact contents. |
| The following shows how to include all direct and transitive dependencies. |
| |
| <configuration> |
| <archiveContent>all</archiveContent> |
| </configuration> |
| |
| The following shows how to exclude all dependencies from the archive. |
| This is useful if you just want the application definition and will use a bundle repository to provision the bundles during deployment. |
| |
| <configuration> |
| <archiveContent>none</archiveContent> |
| </configuration> |
| |
| The following specifies the default of including only the direct dependencies (assumes the application contents and direct dependencies are the same). |
| |
| <configuration> |
| <archiveContent>applicationContent</archiveContent> |
| </configuration> |