Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
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