Uploaded image for project: 'Maven Enforcer Plugin'
  1. Maven Enforcer Plugin
  2. MENFORCER-139

Regex rule example is incorrect; matching is not described

    XMLWordPrintableJSON

Details

    Description

      The documentation page [1] has an example rule containing:

      <regex>\d</regex>
      <regexMessage>You must have a digit in your baseDir!</regexMessage>
      

      This is very misleading, as \d only matches a single digit.
      The example should be:

      <regex>.*\d.*</regex>
      <regexMessage>You must have a digit in your baseDir!</regexMessage>
      

      or possibly:

      <regex>\d</regex>
      <regexMessage>Your baseDir must consist of a single digit only!</regexMessage>
      

      The documentation should state that the regex is applied to the entire value of the property.
      That is, it uses regex "match" rather than regex "contains", effectively the regex string is enclosed in "^" and "$" before use.

      [1] http://maven.apache.org/enforcer/enforcer-rules/requireProperty.html

      Attachments

        Activity

          People

            pgier Paul Gier
            sebb Sebb
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: