Buildr - 在打包战争中过滤 web.xml
使用Buildr打包war时是否可以过滤web.xml文件?
构建器文档:
没有太多提示,package :war 就会选择 src/main/webapp 目录并将其放置在 WAR 的根目录下
我在 web.xml 中定义了一个占位符或令牌,我想在打包 war 时根据我正在构建的环境替换它。最好的方法是什么?封装方法有过滤选项吗?
Is it possible to filter the web.xml file when packaging a war using Buildr?
Buildr documentation:
Without much prompting, package :war picks the contents of the
src/main/webapp directory and places it at the root of the WAR
I have a place holder or token defined in the web.xml and I would like to replace it when packaging the war depending on which env I am building. What is the best way to go about it? Is there a filtering option for the package method?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以指示 Buildr 过滤
src/main/webapp
下的资源,并将生成的文件放置在target/webapp
下,然后将您的新任务与资源任务(即打包前隐式需要),
最后将过滤后的资源进行打包,
更多过滤细节请参见http://buildr.apache.org/building.html#resources
You can instruct Buildr to filter your resources under
src/main/webapp
and place the resulting files undertarget/webapp
,then wire your new task with the resources tasks (which is implicitly required before packaging),
and finally package the filtered resources,
For more details about filtering, see http://buildr.apache.org/building.html#resources