• 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
  • version_cleanup ';' VERSION
    Macro

    Cleanup a potential maven version to make it match the OSGi Version syntax.

    The version_cleanup macro takes a version-ish string and cleans it up, producing the OSGi Version syntax.

    For example, a Maven version can be turned into the OSGi Version syntax:

    ${version_cleanup;1.2.3-SNAPSHOT} -> 1.2.3.SNAPSHOT
    
    1. If the argument passed in is null, the version returned is 0.
    2. If the argument passed is a valid OSGi version range the range is returned unaltered.
    3. If the argument is a version range matching the regular expression (\\(|\\[)\\s*([-.\\w]+)\\s*,\\s*([-.\\w]+)\\s*(\\]|\\)) (with java.util.regex.Pattern.DOTALL enabled) a sufficiently cleaned up OSGi Version range is returned.
    4. If the argument is a version string matching the regular expression (\\d+)(\\.(\\d+)(\\.(\\d+))?)?([^\\p{Alnum}](.*))? (with java.util.regex.Pattern.DOTALL enabled) a sufficiently cleaned up OSGi Version string is returned.
Search
    • Home