Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在maven原型中生成动态文件?_Maven_Archetypes_Maven Archetype - Fatal编程技术网

如何在maven原型中生成动态文件?

如何在maven原型中生成动态文件?,maven,archetypes,maven-archetype,Maven,Archetypes,Maven Archetype,我想将参数传递到archetype resources>src>main文件夹中的文件。 因此,我在archetype-metadata.xml中将required属性声明为 默认值 并在原型文件中使用了${myParam},但其值未被替换。为什么? 若我在prototype项目的pom.xml中使用自定义值,那个么结果项目将用myValue替换${myParam}的值。它可以很好地工作,但对prototype文件夹中的文件不起作用。为什么?您需要告诉Velocity引擎您的文件应该用作Ve

我想将参数传递到archetype resources>src>main文件夹中的文件。 因此,我在archetype-metadata.xml中将required属性声明为


默认值
并在原型文件中使用了${myParam},但其值未被替换。为什么?


若我在prototype项目的pom.xml中使用自定义值,那个么结果项目将用myValue替换${myParam}的值。它可以很好地工作,但对prototype文件夹中的文件不起作用。为什么?

您需要告诉Velocity引擎您的文件应该用作Velocity模板(以便它实际替换在文件中找到的任何属性)。通过扩展
原型元数据.xml
文件并定义

我不确定您的确切文件夹结构以及所讨论的文件的名称,但大致如下:


默认值
总工程师/总工程师
**/*
基本上,上面告诉它包括
src/main
下的所有文件,重要的部分是
filtered=true
,这将导致替换所有属性