Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-7052

Do not allow symbols as first character of identifiers in the POM

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • 4.x / Backlog
    • Core
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              martinkanters Martin Kanters
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated: