Fork me on GitHub

Plugin Details

This report describes goals, parameters details, requirements and sample usage of this plugin.

Goals

Goals available for this plugin:

Goal Description
tycho-custom-bundle:custom-bundle Creates a custom OSGi bundle by combining files from a base bundle location with additional file sets.

This plugin is useful when you need to create custom bundle variants with additional or modified content. It takes an existing OSGi bundle structure (with META-INF/MANIFEST.MF) and allows you to:

  • Include or exclude specific files from the base bundle location
  • Add additional files from other locations (like compiled classes, resources, etc.)
  • Attach the resulting bundle as an artifact with a custom classifier
  • Update the Bundle-Version in the manifest to match the expanded project version

Example Configuration

This example creates a custom bundle by combining a base bundle structure from the custom directory with compiled classes from the build output:

<plugin>
  <groupId>org.eclipse.tycho.extras</groupId>
  <artifactId>tycho-custom-bundle-plugin</artifactId>
  <version>${tycho-version}</version>
  <executions>
    <execution>
      <id>custom-bundle</id>
      <phase>package</phase>
      <goals>
        <goal>custom-bundle</goal>
      </goals>
      <configuration>
        <!-- Base bundle location containing META-INF/MANIFEST.MF -->
        <bundleLocation>${project.basedir}/custom</bundleLocation>
        
        <!-- Classifier for the attached artifact -->
        <classifier>attached</classifier>
        
        <!-- Optional: patterns to include from bundleLocation (default: **/*.*) -->
        <includes>
          <include>**/*.txt</include>
          <include>META-INF/**</include>
        </includes>
        
        <!-- Optional: patterns to exclude from bundleLocation -->
        <excludes>
          <exclude>**/*.bak</exclude>
        </excludes>
        
        <!-- Additional files to include in the bundle -->
        <fileSets>
          <fileSet>
            <directory>${project.build.outputDirectory}</directory>
            <includes>
              <include>**/*.class</include>
            </includes>
          </fileSet>
        </fileSets>
      </configuration>
    </execution>
  </executions>
</plugin>

Requirements

  • The bundleLocation directory must contain a valid OSGi manifest file at META-INF/MANIFEST.MF
  • The manifest must contain valid OSGi bundle headers (Bundle-SymbolicName, etc.)
  • At least one fileSet must be configured to specify additional files to include

Output

The plugin creates a JAR file named <artifactId>-<version>-<classifier>.jar in the project's build directory and attaches it to the project with the specified classifier. The Bundle-Version in the manifest is automatically updated to match the expanded version from the project (including qualifiers).

This plugin supports reproducible builds through the outputTimestamp parameter.

System Requirements

The following specifies the minimum requirements to run this Maven plugin:

Maven 3.9.11
JDK 21

System Requirements History

The following specifies the minimum requirements to run this Maven plugin for historical versions:

Plugin Version Maven JDK
5.0.0 3.9.9 21
from 4.0.0 to 4.0.13 3.9.0 17
from 3.0.0 to 3.0.5 - 17
from 2.0.0 to 2.7.5 - 11
from 1.1.0 to 1.7.0 - 8
from 0.23.0 to 1.0.0 - 7
0.22.0 - 6
from 0.14.0 to 0.21.0 - 5

Usage

You should specify the version in your project's plugin configuration:

<project>
  ...
  <build>
    <!-- To define the plugin version in your parent POM -->
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.eclipse.tycho.extras</groupId>
          <artifactId>tycho-custom-bundle-plugin</artifactId>
          <version>6.0.0-SNAPSHOT</version>
        </plugin>
        ...
      </plugins>
    </pluginManagement>
    <!-- To use the plugin goals in your POM or parent POM -->
    <plugins>
      <plugin>
        <groupId>org.eclipse.tycho.extras</groupId>
        <artifactId>tycho-custom-bundle-plugin</artifactId>
      </plugin>
      ...
    </plugins>
  </build>
  ...
</project>

For more information, see "Guide to Configuring Plug-ins"