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

requireProperty documentation's example for property.version uses wrong regex

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0.1
    • 1.1
    • Standard Rules
    • None
    • Patch

    Description

      Using the example from http://maven.apache.org/enforcer/enforcer-rules/requireProperty.html states to use <regex>(\d|-SNAPSHOT)$</regex> for checking that property.version ends in a digit or -SNAPSHOT. However the code in http://svn.apache.org/repos/asf/maven/enforcer/trunk/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireProperty.java revision 805190 uses java.lang.String.matches in line 73. So 1.1-SNAPSHOT or 1.1 will not match. I attach a patch for the documentation which uses <regex>.*(\d|-SNAPSHOT)$</regex> which will succeed.

      Attachments

        Activity

          People

            pgier Paul Gier
            mfriedenhagen Mirko Friedenhagen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: