Mirko Friedenhagen created MENFORCER-125:
--------------------------------------------
Summary: requireProperty documentation's example for
property.version uses wrong regex
Key: MENFORCER-125
URL: https://jira.codehaus.org/browse/MENFORCER-125
Project: Maven 2.x Enforcer Plugin
Issue Type: Bug
Components: Standard Rules
Affects Versions: 1.0.1
Environment: mvn --version
Apache Maven 3.0.4-RC3 (r1210461; 2011-12-05 14:58:54+0100)
Maven home: /usr/local/Cellar/maven/current/libexec
Java version: 1.6.0_29, vendor: Apple Inc.
Java home: /Library/Java/JavaVirtualMachines/1.6.0_29-b11-402.jdk/Contents/Home
Default locale: de_DE, platform encoding: MacRoman
OS name: "mac os x", version: "10.7.2", arch: "x86_64", family: "mac"
Reporter: Mirko Friedenhagen
Attachments: fix-documentation-for-requireProperty.patch
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.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira