• 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
    • Plain JUnit Testing with OSGi (PRELIMENARY)
    • Testing
    • Packaging Applications
    • Wrapping Libraries to OSGi Bundles
    • Commands
    • For Developers
    • Tools bound to bnd
    • Headers
    • Instruction Reference
    • Instruction Index
    • Macro Reference
    • Macro Index
    • Plugins
    • Settings
    • Errors
    • Warnings
    • Frequently Asked Questions
  • maven_version ';' MAVEN-VERSION

    layout: default

    /**
     * A macro to convert a maven version to an OSGi version
     */
    
    public String _maven_version(String args[]) {
    	if (args.length > 2)
    		error("${maven_version} macro receives too many arguments " + Arrays.toString(args));
    	else if (args.length < 2)
    		error("${maven_version} macro has no arguments, use ${maven_version;1.2.3-SNAPSHOT}");
    	else {
    		return cleanupVersion(args[1]);
    	}
    	return null;
    }
    
    • GitHub