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

RequiredProperty not set in batch mode

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • backlog
    • 3.0.0
    • Plugin
    • None

    Description

      Same issue as https://issues.apache.org/jira/browse/ARCHETYPE-318.

      If I specify a required property and then use that in another required property, as follows:

      	<requiredProperties>
      		<requiredProperty key="groupName">
      		</requiredProperty>
      		<requiredProperty key="serviceName">
      		</requiredProperty>
      		<requiredProperty key="groupId">
      			<defaultValue>com.example.${groupName}</defaultValue>
      		</requiredProperty>
      		<requiredProperty key="package">
      			<defaultValue>com.example.${groupName}</defaultValue>
      		</requiredProperty>
      		<requiredProperty key="artifactId">
      			<defaultValue>${serviceName}</defaultValue>
      		</requiredProperty>
      		<requiredProperty key="version">
      			<defaultValue>1.0.0-SNAPSHOT</defaultValue>
      		</requiredProperty>
      	</requiredProperties>
      

      When I run an archetype generate with those properties specified:

      mvn archetype:generate -B -DarchetypeGroupId=com.example -DarchetypeArtifactId=example-archetype -DgroupName=MyGroup -DserviceName=MyService
      

      I get the following output:

      [INFO] Parent element not overwritten in /private/tmp/${serviceName}/${serviceName}-app/pom.xml
      [INFO] Parent element not overwritten in /private/tmp/${serviceName}/${serviceName}-proxy/pom.xml
      [INFO] Parent element not overwritten in /private/tmp/${serviceName}/${serviceName}-dto/pom.xml
      [INFO] Parent element not overwritten in /private/tmp/${serviceName}/${serviceName}-integration-tests/pom.xml
      [INFO] Parent element not overwritten in /private/tmp/${serviceName}/${serviceName}-codegen/pom.xml
      [INFO] project created from Archetype in dir: /private/tmp/${serviceName}
      

      I'll do a pull request on github.

      Attachments

        Issue Links

          Activity

            People

              rfscholte Robert Scholte
              mnorris1 Max Norris
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 4h
                  4h
                  Remaining:
                  Remaining Estimate - 4h
                  4h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified