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

Chris Snyder commented on ARCHETYPE-490:
----------------------------------------

StackOverflow post discussing this problem (note that this bug doesn't occur in 
batch mode):

https://stackoverflow.com/questions/40136085/maven-archetype-generate-a-default-value-for-requiredproperty-from-a-value-of-a

> Required property default value incorrect when using system property
> --------------------------------------------------------------------
>
>                 Key: ARCHETYPE-490
>                 URL: https://issues.apache.org/jira/browse/ARCHETYPE-490
>             Project: Maven Archetype
>          Issue Type: Bug
>          Components: Generator, Plugin
>    Affects Versions: 2.3, 2.4
>            Reporter: Christopher Rowland
>            Priority: Major
>              Labels: easyfix, newbie, patch
>         Attachments: ARCHETYPE-490.patch
>
>
> When performing a generation while passing in artifactId, groupId, or version 
> as a system property, required property default values using velocity 
> expressions are evaluated incorrectly.
> As an example, I have an archetype with groupId com.apache and artifactId 
> automation-archetype. If I attempt to generate using the following command:
> mvn archetype:generate -DarchetypeGroupId=com.apache 
> -DarchetypeArtifactId=automation-archetype -DartifactId=hello-world-automation
> And I have a required property defined as:
> <requiredProperty key="artifactPackage">
>     <defaultValue>${artifactId.replace("-", "_")}</defaultValue>
> </requiredProperty>
> Then the resulting property is evaluated to automation_archetype instead of 
> hello_world_automation.
> This changed from version 2.2 to 2.3 by a patch introduced in ARCHETYPE-397.
> Proposed additional patch is attached.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to