maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ARCHETYPE-487) Input validation for required properties defined in artifact descriptor
Date Wed, 01 Jun 2016 11:22:59 GMT

    [ https://issues.apache.org/jira/browse/ARCHETYPE-487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15310151#comment-15310151
] 

ASF GitHub Bot commented on ARCHETYPE-487:
------------------------------------------

Github user michael-o commented on a diff in the pull request:

    https://github.com/apache/maven-archetype/pull/7#discussion_r65342854
  
    --- Diff: maven-archetype-plugin/src/main/java/org/apache/maven/archetype/ui/ArchetypeConfiguration.java
---
    @@ -19,12 +19,15 @@
      * under the License.
      */
     
    +import org.apache.maven.archetype.common.Constants;
    +import org.codehaus.plexus.util.StringUtils;
    --- End diff --
    
    Yes, though it was the right thing to do. It is still unrelated to this PR. Code improvements
are always welcome and shall be made with separate PRs.
    
    Thank you!


> Input validation for required properties defined in artifact descriptor
> -----------------------------------------------------------------------
>
>                 Key: ARCHETYPE-487
>                 URL: https://issues.apache.org/jira/browse/ARCHETYPE-487
>             Project: Maven Archetype
>          Issue Type: New Feature
>          Components: Archetypes, Generator, Plugin
>            Reporter: Manuel Ryan
>            Priority: Minor
>
> Add the possibility to define validation regular expressions for required properties
in artifact descriptors.
> Use the regular expressions to validate user input (and ask the user to try again if
the expression doesn't match)
> here's an example of a property that is required by the archetype to be only lower case
alphabet characters:
> --- in archetype-metadata.xml :
> <requiredProperty key="username">
>     <validationRegex>^[a-z]*$</validationRegex>
> </requiredProperty>
> --- at prompt :
> Define value for property 'username' (should match expression '^[a-z]*$'): John
> Value does not match the expression, please try again: john
> Define value for property...



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message