You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Esteban DUGUEPEROUX (JIRA)" <ji...@apache.org> on 2019/01/07 16:59:00 UTC

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

Esteban DUGUEPEROUX created ARCHETYPE-558:
---------------------------------------------

             Summary: 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


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
(v7.6.3#76005)