Uploaded image for project: 'Maven Archetype'
  1. Maven Archetype
  2. ARCHETYPE-397

Required property default value is not displayed correctly if a Velocity expression

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2
    • 2.3
    • Generator
    • None

    Description

      If you use a Velocity expression to define a default value in your archetype descriptor, it is not displayed correctly when you generate a project.
      Let's say we have, in our descriptor :
      <requiredProperty key="package">${groupId}.${artifactId}</requiredProperty>
      When you generate a project from the archetype, you type com.company as a groupId and my-project as an artifactId. Then you'll be prompted for the package and default value will be displayed as "com.company.my-project".
      Now, if we have in our descriptor :
      <requiredProperty key="package">${groupId}.${artifactId.replace('-','')}</requiredProperty>
      When you generate a project in the same way, the default value for package will be displayed as ${groupId}.${artifactId.replace('-','')} instead of com.company.myproject.
      Note that if you leave the value as it is, the generation will do resolve the expression (package property will be resolve correctly). It's just confusing when the default value is showed at the prompt step.

      Attachments

        1. fix_archetype_397.patch
          6 kB
          Emmanuel Hugonnet

        Issue Links

          Activity

            People

              olamy Olivier Lamy
              ndupont Nicolas Dupont
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: