• 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
  • vmax (';' LIST )*

    Prev Next
    Macro
    Find the maximum version in one or more lists

    Summary

    The vmax macro compares version strings using OSGi semantic versioning rules and returns the maximum (highest) version.

    Syntax

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

    Parameters

    • list - One or more semicolon-separated lists of version strings

    Behavior

    • Parses all values as OSGi versions
    • Compares using semantic versioning rules
    • Returns the highest version string
    • Handles major.minor.micro.qualifier format

    Examples

    Find maximum version:

    ${vmax;1.2.3,2.0.0,1.0.5}
    # Returns: "2.0.0"
    

    Multiple lists:

    ${vmax;1.5.0,2.0.0;1.2.3,3.0.0}
    # Returns: "3.0.0"
    

    Get latest version:

    latest.version=${vmax;${available.versions}}
    

    Use Cases

    • Finding latest version
    • Version range calculations
    • Dependency analysis
    • Latest version selection
    • Version comparison

    Notes

    • Uses OSGi semantic versioning
    • Qualifiers compared lexicographically
    • Invalid versions may cause errors
    • See also: ${vmin} for minimum version
    • See also: ${vcompare} for comparison

    See test cases in MacroTestsForDocsExamples.java

Prev Next
Search
    • Home