Hello,

I followed the instructions from
http://maven.apache.org/enforcer/enforcer-rules/requireProperty.html
and put the example configuration into my pom:

                           <requireProperty>
                                <property>project.version</property>
                                <message>"Project version must be
specified."</message>
                                <regex>(\d|-SNAPSHOT)$</regex>
                                <regexMessage>"Project version must
end in a number or -SNAPSHOT."</regexMessage>
                            </requireProperty>

My project.version does end in -SNAPSHOT, however Maven keeps complaining:
[DEBUG] Executing rule: org.apache.maven.plugins.enforcer.RequireProperty
[DEBUG] Adding failure due to exception
org.apache.maven.enforcer.rule.api.EnforcerRuleException: "Project
version must end in a number or -SNAPSHOT."
        at 
org.apache.maven.plugins.enforcer.RequireProperty.execute(RequireProperty.java:81)

Looking at 
http://svn.apache.org/viewvc/maven/enforcer/tags/1.0.1/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireProperty.java?view=markup
the rule uses String.matches in line 73.

Changing to <regex>.*(\d|-SNAPSHOT)$</regex> does succeed, so probabyl
only the example is wrong.

Regards Mirko
--
http://illegalstateexception.blogspot.com/
https://github.com/mfriedenhagen/
https://bitbucket.org/mfriedenhagen/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to