• Intro Headers Instructions Macros Commands
  • Fork me on GitHub
    • Introduction
    • How to install bnd
    • Guided Tour
    • Guided Tour Workspace & Projects
    • Concepts
    • Best practices
    • Build
    • Generating JARs
    • Versioning
    • Baselining
    • Service Components
    • Metatype
    • Contracts
    • Manifest Annotations
    • Resolving Dependencies
    • Launching
    • Testing
    • Packaging Applications
    • Wrapping Libraries to OSGi Bundles
    • From the command line
    • For Developers
    • Plugins
    • Tools bound to bnd
    • Header Reference
    • Instruction
    • Instruction Index
    • Macro Reference
    • Macro Index
    • Command Reference
    • Plugins Reference
    • Settings
    • Errors
    • Warnings
    • Frequently Asked Questions
  • -include PATH-SPEC ( ',' PATH-SPEC ) *

    You can use -include as follows:

    -include: <path or url>
    

    This will read the path or url as a properties or manifest file (if it ends in .MF).

    It is important to realize that the include is not handled by the parser. That is, it is not a normal text include. The properties parser will read all properties in one go and then inspect the Properties object for the -include instruction. It then parses the paths or URLs in the -include instruction one by one in order. By default, the read properties do not override the properties that were set in the same file as the -include instruction.

    There are two possible options. The path/URL starts with a:

    • ~ – The included properties override the locally set properties.
    • - – If file or URL or path does not exist then do not report an error.

    Examples

    # Read an optional file in the user's home directory
    -include ${java.home}/.xyz/base.bnd
    
    # Read a manifest
    -include META-INF/MANIFEST.MF
    
    # Use a URL
    -include http://example.com/foo/bar/setup.bnd
    
    # Read several
    
    -include first.bnd, second.properties, ~third.override
    
    • Contact
    • Developers
    • More