You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Matthew Jason Benson (Jira)" <ji...@apache.org> on 2021/06/28 19:49:00 UTC

[jira] [Commented] (ARCHETYPE-558) Allow transitive requiredProperty from non default ones

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

Matthew Jason Benson commented on ARCHETYPE-558:
------------------------------------------------

This seems like a possible duplicate of ARCHETYPE-406.

> Allow transitive requiredProperty from non default ones
> -------------------------------------------------------
>
>                 Key: ARCHETYPE-558
>                 URL: https://issues.apache.org/jira/browse/ARCHETYPE-558
>             Project: Maven Archetype
>          Issue Type: New Feature
>          Components: Generator
>    Affects Versions: 3.0.1
>            Reporter: Esteban DUGUEPEROUX
>            Priority: Major
>
> Hi,
> I want to create a Maven Archetype with 2 requiredProperty :
>  
> <requiredProperty key="apiName" />
> <requiredProperty key="resourceName" />
>  
> apiName is used for the artifactId as follow:
> <requiredProperty key="artifactId">
>  <defaultValue>${apiName}</defaultValue>
>  </requiredProperty>
>  
> I want also to define transitive properties from these 2 first properties:
>  
> <requiredProperty key="camelCaseAPIName">
>  <defaultValue>${artifactId.replaceAll("^a|-a", "A").replaceAll("^b|-b", "B").replaceAll("^c|-c", "C").replaceAll("^d|-d", "D").replaceAll("^e|-e", "E").replaceAll("^f|-f", "F").replaceAll("^g|-g", "G").replaceAll("^h|-h", "H").replaceAll("^i|-i", "I").replaceAll("^j|-j", "J").replaceAll("^k|-k", "K").replaceAll("^l|-l", "L").replaceAll("^m|-m", "M").replaceAll("^n|-n", "N").replaceAll("^o|-o", "O").replaceAll("^p|-p", "P").replaceAll("^q|-q", "Q").replaceAll("^r|-r", "R").replaceAll("^s|-s", "S").replaceAll("^t|-t", "T").replaceAll("^u|-u", "U").replaceAll("^v|-v", "V").replaceAll("^w|-w", "W").replaceAll("^x|-x", "X").replaceAll("^y|-y", "Y").replaceAll("^z|-z", "Z")}</defaultValue>
>  </requiredProperty>
>  <requiredProperty key="camelCaseResourceName">
>  <defaultValue>${resourceName.replaceAll("^a|-a", "A").replaceAll("^b|-b", "B").replaceAll("^c|-c", "C").replaceAll("^d|-d", "D").replaceAll("^e|-e", "E").replaceAll("^f|-f", "F").replaceAll("^g|-g", "G").replaceAll("^h|-h", "H").replaceAll("^i|-i", "I").replaceAll("^j|-j", "J").replaceAll("^k|-k", "K").replaceAll("^l|-l", "L").replaceAll("^m|-m", "M").replaceAll("^n|-n", "N").replaceAll("^o|-o", "O").replaceAll("^p|-p", "P").replaceAll("^q|-q", "Q").replaceAll("^r|-r", "R").replaceAll("^s|-s", "S").replaceAll("^t|-t", "T").replaceAll("^u|-u", "U").replaceAll("^v|-v", "V").replaceAll("^w|-w", "W").replaceAll("^x|-x", "X").replaceAll("^y|-y", "Y").replaceAll("^z|-z", "Z")}</defaultValue>
>  </requiredProperty>
>  
> to have a camel case version of the 2 first properties.
> For camelCaseAPIName property, it works because it uses artifactId property which is same as apiName. But for camelCaseResourceName it doesn't works because resourceName property is not added in velocity context. Only requiredProperty with no value and default value are set in velocity context.
> See org.apache.maven.archetype.ui.generation.DefaultArchetypeGenerationConfigurator.configureArchetype(ArchetypeGenerationRequest, Boolean, Properties) line 262.
>  
> Could we have velocity context extended to property with value and no default value?
>  
> Best Regards.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)