• Intro Headers Instructions Macros Commands
Fork me on GitHub
    • Getting Started
      • How to install bnd
      • Guided Tour
      • Guided Tour Workspace & Projects
      • FAQ - Frequently Asked Questions
    • Concepts and Practices
      • Introduction
      • Concepts
      • Best practices
    • Build and Development
      • Project Setup
      • Generating JARs
      • Versioning
      • Baselining
      • Service Components
      • Metatype
      • Contracts
      • Bundle Annotations
      • Accessor Properties
      • SPI Annotations
    • Dependency and Launching
      • Resolving Dependencies
      • Launching
      • Startlevels
    • Testing
      • Testing
      • Testing with Launchpad
    • Packaging and Distribution
      • Packaging Applications
      • JPMS Libraries
      • Wrapping Libraries to OSGi Bundles
    • Documentation and Tools
      • Generating Documentation
      • Commands
      • For Developers
      • Templates for Workspaces
      • Tips for Windows users
      • Tools bound to bnd
    • Reference Material
      • Reference
      • Headers
      • Instruction Reference
      • Instruction Index
      • Macro Reference
      • Macro Index
      • Plugins
      • External Plugins
    • Configuration and Troubleshooting
      • Settings
      • Errors
      • Warnings
  • -export PATH ( ';' PARAMETER )* ( ',' PATH ( ';' PARAMETER )* )*
    Project

    Turns a bndrun file into its deployable format

    The -export instruction can be used to export a bndrun or bnd file to an executable JAR during the build process. In contrast to the export functions, this -export instruction is supported in all drivers, including Eclipse. It can be used to continously build executable JARs or other supported exporters. It can only be used in the top level bnd.bnd file.

    The format of the -export instruction is:

    -export     ::= filespec ( ',' filespec )*
    filespec    ::= path (';' PARAMATER )*
    

    The path is either a relative path in the project directory or it is a wildcard specification using globs. All files in the project directory are selected. In general, these should be bnd or bndrun files.

    The following attributes are architected:

    • type – The type specifies the exporter type. The default type is bnd.executablejar.pack.
    • name – Overrides the default name of the output file. It should contain the extension. The file should not have path segments, it will be placed in the target directory. Without a name, the exporter defines the file name since the extensions can differ depending on the exporter.
    • bsn – Set the bundle symbolic name of the resulting JAR file if possible
    • version – Set the version of the resulting JAR file if possible
    • other – Any remaining properties are added to the properties of the run file. For example, -profile can be used to select a specific property profile.

    The -exporttype can be used to set some default attributes for a specific type.

    Exporters

    The Exporters use a plugin mechanism and therefore the list is not closed. The following exporters are supported by bnd out of the box:

    • bnd.executablejar.pack – Exports a JAR file using the launcher from the -runpath or the default if no launcher is specified.
    • bnd.executablejar – Similar to the previous but does not support profiles, has no automatic bsn assigned, and entries are not signed. The reason there are two types for the more or less the same format with subtle differences is for backward compatibility.
    • bnd.runbundles – A JAR with the runbundles. As optional Attributes targetDir will output all runbundles in the set directory in the resulting jar and template will use a given jar/zip or directory as template to which the bundles will be added.
    • osgi.subsystem.application – Export into an application subsystem
    • osgi.subsystem.feature – Export into a feature subsystem
    • osgi.subsystem.composite – Export into a composite subsystem
    • p2 – Export a P2 repository

    Example

    For example:

    -export: \
        foo.bndrun; \
            -profile=debug; \
            -runkeep=true; \
            name = "foo.jar, \
        bar.bndrun
    

    Backward Compatibility

    If the filespec clause does not set the type nor the name then it is assumed the backward compatible mode is required. This will set the output name to the file name with a .jar extension and it will set the bundle symbolic name.

Search
    • Home