• Intro Headers Instructions Macros Commands
Fork me on GitHub
    • Getting Started
      • Introduction
      • How to install bnd
      • Guided Tour Workspace & Projects
      • bnd / bndlib Features and JAR Wrapping Techniques
      • FAQ - Frequently Asked Questions
    • Concepts and Practices
      • Concepts
      • Background
      • Best practices
    • Build and Development
      • Build
      • 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
      • bnd CLI 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
  • join ( ';' LIST )+

    Prev Next
    Macro
    Combine multiple lists into a single comma-separated list

    Summary

    The join macro combines one or more lists into a single comma-separated list. It flattens all input lists and returns them joined with commas.

    Syntax

    ${join;<list>[;<list>...]}
    

    Parameters

    • list - One or more lists to combine (items within lists can be comma or semicolon-separated)

    Behavior

    • Splits each input list into individual elements
    • Combines all elements from all lists
    • Returns a single comma-separated list
    • Preserves the order of elements
    • Removes empty elements

    Examples

    Join two lists:

    ${join;apple,banana;cherry,date}
    # Returns: "apple,banana,cherry,date"
    

    Join multiple lists:

    ${join;red,green;blue;yellow,orange}
    # Returns: "red,green,blue,yellow,orange"
    

    Flatten nested lists:

    list1=a,b,c
    list2=d,e,f
    ${join;${list1};${list2}}
    # Returns: "a,b,c,d,e,f"
    

    Combine with other macros:

    ${join;${exports};${imports}}
    # Returns all exported and imported packages
    

    Use Cases

    • Combining multiple configuration lists
    • Merging classpath or dependency lists
    • Concatenating package lists
    • Building composite values from multiple sources
    • Flattening nested list structures
    • Creating unified collections

    Notes

    • Input lists can use comma or semicolon separators
    • Output is always comma-separated
    • Empty elements are filtered out
    • Element order is preserved
    • No deduplication - duplicate elements are kept
    • To join with a custom separator (not comma), use ${sjoin;<separator>;<list>...} instead
    • See also: ${uniq} for removing duplicates
    • See also: ${sjoin} for custom separator joining

    See test cases in MacroTestsForDocsExamples.java

Prev Next
Search
    • Home