Creating Maven ArcheType . Setting file name

后端 未结 2 1335
忘掉有多难
忘掉有多难 2021-02-13 20:30

I want to create an Archetype in which the user can provide artifactId. Then I want to take this artifactId and create two files.

Here is an ex

2条回答
  •  忘掉有多难
    2021-02-13 20:58

    There is a bug in maven archetype. See bug reports ARCHETYPE-406 and ARCHETYPE-397.

    When fixed it will be possible to define and use custom requiredProperty for your case.

    In archetype-metadata.xml add

    
      
        
          ${artifactId.substring(0,1).toUpperCase()}${artifactId.substring(1)}
        
      
    
    

    Don't forget to add classPrefix to archetype.properties

提交回复
热议问题