[ 
https://jira.codehaus.org/browse/ARCHETYPE-318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=276627#comment-276627
 ] 

Tuomas Kiviaho commented on ARCHETYPE-318:
------------------------------------------

>This patch unifies interactive and batch mode behavior.
filtering is done only in part of the code that get's executed when interactive 
mode is used. Batch mode has completely separate handling. I merged these two 
execution paths together so that the only real difference is that required user 
input in interactive mode is replaced with default values in batch mode

>Replacement of required properties now fails if transitive properties are not 
>resolved.
code seems to call as property values containing references to other properties 
(like ${artifactId}.itest1) as 'transitive properties'. If property references 
can't be resolved the build fails.

>There (is) also an oddity...
Codebase seems to treat groupId, artifactId, version (and package) a bit 
differently than other properties. Properties with same name can't be 
configured for instance as optional because what you'd only be generating 
duplicate properties with same name. This is just something that caught my eye.

There wasn't existing test cases to begin with so I only could test with my own 
code and while trying to keep the number of changed lines in minimum.


> <requiredProperty> <defaultValue> not correctly filtered
> --------------------------------------------------------
>
>                 Key: ARCHETYPE-318
>                 URL: https://jira.codehaus.org/browse/ARCHETYPE-318
>             Project: Maven Archetype
>          Issue Type: Bug
>          Components: Generator
>    Affects Versions: 2.0-alpha-5
>            Reporter: Jochen Ehret
>            Priority: Minor
>             Fix For: 2.x
>
>         Attachments: DefaultArchetypeGenerationConfigurator.patch
>
>
> In our archetype-metadata.xml we´ve defined a <requiredProperty> with a 
> default value like this:
> {code:xml}<requiredProperty key="subArtifactId">
>     <defaultValue>${artifactId}.itest1</defaultValue>
> </requiredProperty>{code}
> When we call "archetype:generate" and enter the parameters in interactive 
> mode everything works fine. But when we try to set the parameter 
> "subArtifactId" on the command line (mvn archetype:generate 
> -DsubArtifactId=xyz) or from an "archetype.properties" file, the value is 
> ignored. In the generated pom.xml the variable ${subArtifactId} is always 
> replaced with "${artifactId}.itest1".

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to