• Intro Headers Instructions Macros Commands
Fork me on GitHub
  • What is bnd?

    “If you want to teach people a new way of thinking, don't bother trying to teach them. Instead, give them a tool, the use of which will lead to new ways of thinking.”
    ― R. Buckminster Fuller

    bnd is the engine behind a number of popular software development tools that support OSGi. It can be found in several maven plugins, ant, gradle, and of course Eclipse (bndtools). It actively seeks other build tool vendors to use bnd to improve the quality of the generated OSGi metadata.

    bnd actually consists of 2 major parts, one part is really good in creating a JAR with OSGi meta data based on instructions and the information in the class files. Over time bnd has collected hundreds of heuristics that provide for good bundles. This part is therefore often used in build tools like maven or gradle that already generate JARs. They mainly use the manifest generation features of bnd.

    The other part is a IDE/build tool independent model of a workspace with projects. This was the result of the frustration that certain things could be done very well in Eclipse but that other things are best done in a command line tool. Since IDEs are incremental and very event driven, command line tools tend to run everything from start to end. What was needed was an independent model that could work with Eclipse, maven, ant, gradle, and hopefully one day Intellij.

    So to use bnd, look at the the descriptions of the tools that include bnd. Then when you want to find out what a certain command does, or how to call a macro, then use this manual.

  • How to get started?

    There are several different ways to get started with bnd. The most elegant one is to start with Bndtools Eclipse IDE. There are a number of videos available that provide a gentle introduction. There is also an accompanying OSGi Starter that provides a lot of detail how to use bnd for larger projects. It includes a Gradle plugin out of the box that will build the Bndtools workspace identical to how things are build inside Eclipse for Continuous Integration with Github Actions or other build servers.

    If you insist on using Maven, then you can start with the description of the Maven plugins.

    There is also a Gradle plugin that is the preferred way to build OSGi bundles with plain old vanilla Gradle. This is described in the Gradle Plugins readme.

    If you just want to figure out how different commands and macros work, the bnd commandline is your friend. Especially the shell command is very useful exploring it.

    Last but not least, the whole source code is on GitHub. So feel free to explore it. And when you like, we're very actively taken outside PR's. There is a lot of activity going on.

  • Table of contents

    1. Introduction
    2. How to install bnd
    3. Guided Tour
    4. Guided Tour Workspace & Projects
    5. Concepts
    6. Best practices
    7. Build
    8. Project Setup
    9. Generating JARs
    10. Versioning
    11. Baselining
    12. Service Components
    13. Metatype
    14. Contracts
    15. Bundle Annotations
    16. Accessor Properties
    17. SPI Annotations
    18. Resolving Dependencies
    19. Launching
    20. Startlevels
    21. Testing
    22. Testing with Launchpad
    23. Packaging Applications
    24. JPMS Libraries
    25. Wrapping Libraries to OSGi Bundles
    26. Generating Documentation
    27. Commands
    28. For Developers
    29. Tips for Windows users
    30. Tools bound to bnd
    31. Reference
    32. Headers
    33. Instruction Reference
    34. Instruction Index
    35. Macro Reference
    36. Macro Index
    37. Plugins
    38. External Plugins
    39. Settings
    40. Errors
    41. Warnings
    42. Frequently Asked Questions
    • GitHub