Skip to content

Latest commit

 

History

History
47 lines (30 loc) · 3.52 KB

File metadata and controls

47 lines (30 loc) · 3.52 KB

Plugin Developer Guide

This guide describes how to develop plugins for OpenFastTrace (OFT).

Initial Setup

  1. Create a new Java project and add dependency org.itsallcode.openfasttrace:openfasttrace-api:

    <dependency>
        <groupId>org.itsallcode.openfasttrace</groupId>
        <artifactId>openfasttrace-api</artifactId>
        <version>[latest version]</version>
    </dependency>
  2. Create a new class (e.g. com.example.oft.import.MyImporter) using one of the following plugin APIs:

    Reporter plugins will usually extend org.itsallcode.openfasttrace.api.report.AbstractReporterFactory instead of implementing ReporterFactory directly so they inherit the standard context handling.

    Importer plugins will usually extend org.itsallcode.openfasttrace.api.importer.AbstractImporterFactory instead of implementing ImporterFactory directly so they inherit the standard context handling.

    Exporter plugins will usually extend org.itsallcode.openfasttrace.api.exporter.AbstractExporterFactory instead of implementing ExporterFactory directly so they inherit the standard exporter and context handling.

  3. Create a file in src/main/resources/$INTERFACE_FQN, using the fully qualified class name of the interface as file name.

  4. Add the fully qualified class name of your new plugin class to the new file, e.g. com.example.oft.import.MyImporter

Runtime Dependencies

OpenFastTrace does not use any third-party runtime dependencies by design. You can add any dependencies to your plugin if required (see note about packaging).

Warning The plugin must not use any classes other than those included in the API openfasttrace-api. All other classes in OFT are internal and may change in incompatible ways even in patch releases.

Packaging

Build your plugin as a normal Java JAR file, e.g. using maven-jar-plugin. The JAR must not contain openfasttrace-api.

Adding Third-Party Dependencies

If your plugin uses third party dependencies, you have two options:

  • Publish and install the plugin and its dependencies as separate JARs.

  • Build a fat JAR, e.g. using maven-shade-plugin and include the plugin's dependencies.

    Important: do not include openfasttrace-api in the fat JAR to avoid having duplicate classes on the classpath at runtime.