如何在Maven原型中设置动态属性名称?

时间:2019-05-06 22:34:09

标签: maven maven-archetype

我正在尝试使用application.properties

中的自定义属性名称来编译Maven原型

我的archetype-metadata.xml

<archetype-descriptor>

  <modules>
    <module id="${rootArtifactId}" dir="__rootArtifactId__" name="${rootArtifactId}">
      <fileSets>
        <fileSet encoding="UTF-8">
          <directory>src/main/resources</directory>
        </fileSet>
        ...
      </fileSets>
    </module>
    ...
  </modules>

  <requiredProperties>
    <requiredProperty key="apiName">
      <defaultValue>${artifactId}</defaultValue>
    </requiredProperty>
  ...
  </requiredProperties>    
</archetype-descriptor>

__rootArtifactId__\src\main\resources,我有一个名为application.properties的文件

我有以下一行:

stilingue.${apiName}.api.enabled=false

因此,当我使用mvn archetype:generate编译该项目时,不会编译变量${apiName}

我需要做些什么来编译它?

0 个答案:

没有答案
相关问题