• 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
  • -fixupmessages SELECTOR ( ';' ( is | replace | restrict ) )* ...
    Project

    Fixup errors and warnings.

    The -fixupmessages instruction is intended to fixup the errors and warnings. It allows you to remove errors and/or warnings, turn errors into warnings, and turn warnings into errors. With this instruction you can fail a build based on a warning or succeed a build that runs into errors.

    The default of this instruction is to list a number of patterns. Any error or warning that matches this pattern is then removed. The following example will remove any error/warning that matches 'some error', 'another error', or 'and yet another error'.

    -fixupmessages:  \
    	some error, 
    	another error, 
    	and yet another error
    

    The pattern is a SELECTOR, which makes it possible to do case insensitive matches, wildcards, literals, etc.

    Syntax

    The basic format of -fixupmessages is:

    -fixupmessages ::= fixup ( ',' fixup ) *
    fixup          ::= SELECTOR directive *
    directive      ::= ';' ( restrict | is | replace )
    restrict       ::= 'restrict:=' ( 'error' | 'warning' )
    is             ::= 'is:=' ( 'ignore' | 'error' | 'warning' )
    replace        ::= 'replace:=' <<text>> 
    

    The value of a fixup clause is a globbing expression.

    Directives

    The following directives are supported:

    • restrict: – By default, the fixup clause is applied to all errors and warnings. You can restrict its application to either errors or warnings specifying either restrict:=error or restrict:=warning.
    • is: – By default an error remains an error and a warning remains a warning. However, if you specify the is: directive you can force an error to become a warning or vice versa. This can be very useful if you build fails with an error that you do not consider a failure.
    • replace: – Replace the message with a new message. The replacement will be processed by the macro processor, the ${@} macro will contain the current message.

    The -fixupmessages instruction is a merged property. This means that you can define it in many different places like for example in a file in cnf/ext. Just put an extension on the instruction. For example:

    -fixupmessages.one: 'Some error'
    -fixupmessages.two: 'Another error'
    

    Examples

    # Turn an error into a warning
    -fixupmessages
      "Invalid character'; \
        restrict:=error;
        is:=warning
      
    # Replace a message
    -fixupmessages \
      "split";replace:=broken
      
    # Ignore case by appending :i
    -fixupmessages \
      "case insensitive:i"
    
    # Wildcards
    -fixupmessages \
      "prefix*suffix"
    
    # Turn properties parser messages into warnings
    -fixupmessages.parser: \
      "Invalid character in properties"; \
      "No value specified for key"; \
      "Invalid property key"; \
      "Invalid unicode string"; \
      "Found \\<whitespace>";
        is:=warning
    
Search
    • Home