• 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
  • propertiesdir

    Prev Next
    Processor
    Get the directory containing the current properties file

    Summary

    The propertiesdir macro returns the absolute path to the directory containing the current properties file being processed.

    Syntax

    ${propertiesdir}
    

    Parameters

    None - this macro takes no parameters and will error if arguments are provided.

    Behavior

    • Returns absolute path to the directory containing the properties file
    • Returns empty string if no properties file is set
    • Generates error if called with arguments

    Examples

    Get properties directory:

    Config-Directory: ${propertiesdir}
    

    Reference sibling files:

    license.file=${propertiesdir}/LICENSE.txt
    

    Relative resources:

    resources=${propertiesdir}/resources
    

    Use Cases

    • Referencing files relative to config
    • Loading resources near bnd files
    • Path construction
    • Configuration organization
    • Related file discovery

    Notes

    • Returns absolute path to directory only
    • Returns empty string if no properties file
    • Cannot take arguments
    • See also: ${propertiesname} for filename
    • See also: ${thisfile} for full path
    • See also: ${basedir} for project root

    TODO Needs review - AI Generated content


    See test cases in MacroTestsForDocsExamples.java

Prev Next
Search
    • Home