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

Property in default-value is not replaced when using automated mode

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • None
    • None
    • None
    • None

    Description

      In archetype-metadata.xml I have:

      <requiredProperty key="package">
      	<defaultValue>${groupId}.${artifactId}</defaultValue>
      </requiredProperty>
      

      This default value is used correctly when using mvn archetype in interactive mode, but it is used incorrectly when using mvn archetype -B. In that case, the value of package is literally ${groupId}.${artifactId} with no replacement.

      To reproduce, type:

      mvn -B archetype:generate -DarchetypeGroupId=io.github.oliviercailloux -DarchetypeArtifactId=java-se-1.8-archetype -DgroupId=mygroupid -DartifactId=myartifactid
      

      then ls a/src/main/java/. Observe that the directory is literally ${groupId} instead of the expected mygroupid.

      This archetype is published to Maven Central and its source code is here.

      Possibly related: 490, comment of 397.

      Attachments

        Issue Links

          Activity

            People

              rfscholte Robert Scholte
              oliviercailloux Olivier Cailloux
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: