Skip to content

1.4. Generated Artifacts

Hilario Fernandes edited this page Nov 7, 2017 · 29 revisions

WIP

Here we seek to provide some information on the accepted formats for pentaho generated artifacts and how to properly configure them.

Jar

Common JAR (Java ARchive) is a package file format typically used to aggregate many Java class files and associated metadata and resources (text, images, etc.) into one file for distribution. The maven-jar-plugin should be used to generate this type of artifact and no configuration other than declaring <packaging>jar</packaging> in the pom file should be necessary for most scenarios.

OSGI Bundle

To create OSGI bundles we make use of the maven-bundle-plugin. If you have properly declared Pentaho parent poms as the parent of your project all you have to do is declare that your project has <packaging>bundle</packaging>. This will allow maven-bundle-plugin to generate the MANIFEST.MF and package your project.

If there is a need to add or override configuration you can do it by extending the plugin and adding the configurations you need.

<plugin>
  <groupId>org.apache.felix</groupId>
  <artifactId>maven-bundle-plugin</artifactId>
  <configuration>
    <instructions>
      <Export-Package>org.foo.myproject.api</Export-Package>
      <Import-Package>org.foo.otherproject,*</Import-Package>
    </instructions>
  </configuration>
</plugin>

Check maven-bundle-plugin for documentation.

OSGI Feature

Features should have their own maven module: When creating new features do not add them manually to any of the existing feature descriptors of the karaf-assembly.

In the respective project, create an assembly module that produces the feature with the karaf-maven-plugin and publishes it as an artifact. When doing so please make sure that you are handling dependency scopes properly in order to avoid bloat. If you are depending on bundles that belong to an existing feature, depend on that feature instead of the concrete bundles.

Finally, include the reference to the published feature artifact in the karaf assembly.

Clone this wiki locally