避免替换表达式原型:create-from-project
嘿, 有人可以告诉我在通过 archetype:create-from-project 创建原型时如何避免替换项目中的某些表达式吗?
例如
,如果程序员从版本 1.0 的项目创建原型,则它会用 ${version}
替换项目中所有出现的“1.0”表达式
更改为
<?xml version="1.0-SNAPSHOT"?>
.... 因为有 在原型资源中,用户输入 1.0-SNAPSHOT 作为项目版本
另外,从原型创建项目时是否可以提供更多参数?除了 groupId、artifactId、package 和 version 之外?
Hey,
could please anybody tell me how to avoid substitution of some expressions in a project when creating an archetype from it via archetype:create-from-project ?
for instance it substitutes all appearances of "1.0" expressions in the project with ${version}
if programmer creates the archetype from project of verion 1.0 <version>1.0</version>
, then for instance header of an xml file
<?xml version="1.0"?>
changes to
<?xml version="1.0-SNAPSHOT"?>
.... because there was <?xml version="${version}"?>
in the archetype resources and users entered 1.0-SNAPSHOT as a project version
Also, is it possible to supply more arguments when creating project from the archetype? In addition to groupId, artifactId, package and version ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将
-Darchetype.filteredExtentions=extension1,extension2,...
添加到您的mvn
命令中,以告诉 maven 在其速度替换中包含哪些文件扩展名。如果您列出所有文件扩展名并省略xml
,它应该会跳过它们。如果xml
是项目中唯一的文件类型,则可以执行-Darchetype.filteredExtentions
。You can add
-Darchetype.filteredExtentions=extension1,extension2,...
to yourmvn
command to tell maven which file extensions to include in its velocity substitutions. If you make a list of all of your file extensions and leave offxml
, it should skip over them. You can do-Darchetype.filteredExtentions
ifxml
is the only file type in your project.