• Intro Headers Instructions Macros
  • Fork me on GitHub
    • Release
    • 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
    • Testing
    • Packaging Applications
    • Wrapping Libraries to OSGi Bundles
    • From the command line
    • For Developers
    • Plugins
    • Tools bound to bnd
    • File Format
    • Header Reference
    • Instruction
    • Instruction Index
    • Macro Reference
    • Command Reference
    • Plugins Reference
    • Settings
    • Errors
    • Warnings
    • Frequently Asked Questions
    Supported by OSGi enRoute
  • Bundle-SymbolicName ::= symbolic-name ( ';' parameter ) *

    The Bundle-SymbolicName header can be set by the user. The default is the name of the main bnd file, or if the main bnd file is called bnd.bnd, it will be the name of the directory of the bnd file. An interesting variable is ${project} that will be set to this default name.

    		private void verifySymbolicName() {
    	Parameters bsn = parseHeader(main.get(Analyzer.BUNDLE_SYMBOLICNAME));
    	if (!bsn.isEmpty()) {
    		if (bsn.size() > 1)
    			error("More than one BSN specified " + bsn);
    
    		String name = bsn.keySet().iterator().next();
    		if (!isBsn(name)) {
    			error("Symbolic Name has invalid format: " + name);
    		}
    	}
    }
    
    		/**
     * @param name
     * @return
     */
    public static boolean isBsn(String name) {
    	return SYMBOLICNAME.matcher(name).matches();
    }
    
    
    public final static String	SYMBOLICNAME_STRING				= "[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)*";
    
    • Contact
    • Developers
    • More