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

Michael Osipov commented on MNG-7052:
-------------------------------------

Regardless of the actual characters, we need to cover more spots:
* We need to decide whether we want to treat item ids just like we treat 
groupId/artifactId on terms of validation
* Only profile ids are covers, what about repo ids and other ids on the POM?
* The settings model does not validation which allows to create items which 
would not pass validation inside a POM

I propose to create a ticket to:
* Collect all affected id items
* Discuss the first point of the list
* settle on a set of chars which does not interfere with: CLI args/options, 
shell interpolation, maven interpolation

Does this sound acceptable?

Note: A profile id cannot start with a plus char because it has a specific 
internal meaning.

> Do not allow symbols as first character of identifiers in the POM
> -----------------------------------------------------------------
>
>                 Key: MNG-7052
>                 URL: https://issues.apache.org/jira/browse/MNG-7052
>             Project: Maven
>          Issue Type: Improvement
>          Components: core
>            Reporter: Martin Kanters
>            Priority: Major
>              Labels: up-for-grabs
>             Fix For: 4.0.x-candidate
>
>
> In the {{DefaultModelValidator}} we currently validate identifiers against 
> {{a-zA-Z0-9-_.}} 
> Since Maven also allows operators to be used against an identifier, this can 
> result in bugs or at least unexpected behavior for the user.
> The minus operator can be used to deactivate a certain profile, so an example 
> would be:
> - A project having a profile with the id {{-id-of-profile}}
> - A Maven invocation of {{mvn <goal> -P-id-of-profile}}.
> The release of Maven 4 is a nice opportunity to restrict the first character 
> of an id to be {{a-zA-Z0-9}} . The other characters may still consist of 
> those symbols.
> This should apply to all identifiers that we support. The methods that need 
> attention are:
> {{DefaultModelValidator#validateId}} and 
> {{DefaultModelValidator#validateIdWithWildcards}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to