EBA Maven Plugin

The EBA Maven Plugin provides the ability to generate EBA archives using Maven. The EBA archive format is described in Applications . An EBA archive can optionally contain an Application manifest (APPLICATION.MF). This can be added in one of two ways

  1. Hand written and added into the archive.
  2. Generated based on pom configuration.

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.

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 . -> Application-SymbolicName Pom -> Application-Name Pom -> Application-Version (cleaned up for OSGi) Pom -> Application-Description * Pom -> Application-Content

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>

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>

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>

Including transitive dependencies (deprecated)

This configuration option is deprecated in favor of .

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>

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>