archetype-metadata.xml 中的 "filtered" 到底是什么

What exactly is "filtered" in archetype-metadata.xml

maven-documentation 不是很有帮助:

Filesets can be filtered, which means the selected files will be used as Velocity templates. They can be non-filtered, which means the selected files will be copied without modification.

所以让我们来看看下面的代码。我知道所选文件将用作 Velocity 模板,因此可以对其进行操作。 如何操作此文件集以及如何使用 Velocity 模板?

<fileSets>
    <fileSet filtered="true" packaged="true">
      <directory>src/test/java</directory>
      <includes>
        <include>**/*.java</include>
      </includes>
      <excludes>
        <exclude>AllTest.java</exclude>
      </excludes>
    </fileSet>
  </fileSets>

如您所说,如果将 filtered 设置为 true,则 Velocity 引擎会获取文件并执行所有 Velocity 替换,包括替换 $ 语法中给出的变量并评估速度循环。

变量值是在 POM 中设置的属性。