Maven原型:在markdown站点文件中引用artifactId

时间:2017-09-08 11:11:22

标签: maven markdown maven-archetype maven-site-plugin

我正在创建一个maven原型。它应该包含一些预定义的文件 src/site/markdown。这些文件应包含artifactId。

我尝试在md文件中使用${artifactId}引用它,但没有运气。

还有其他想法吗?

2 个答案:

答案 0 :(得分:0)

对于archetype-metadata.xml中的相应文件集,需要设置filtered=true

答案 1 :(得分:0)

我遇到了同样的问题,这就是我解决它的方式。

我在resources/META-INF/maven/archetype-metadata.xml中添加了

<fileSet encoding="UTF-8" filtered="true">
  <directory></directory>
  <includes>
    <include>README.md</include>
  </includes>
</fileSet>

然后在我添加的resources/archetype-resources/README.md

The name of the project is ${artifactId}

现在,当我使用该原型构建Maven项目时,在artifactId文件中填充了README.md的值。