Show Table of Contents
10.8. 部署描述符覆盖
EAP 6.1.x 里有一个新的功能,它允许您在运行时覆盖部署描述符、JAR、类、JSP 页面和其他文件。deployment overlay 代表了归档里的一个规则集文件,它必须被覆盖。它也提供到应该替代被覆盖文件的新文件的链接。如果在部署归档里没有出现被覆盖的文件,那它会被添加回部署里。
过程 10.16. 用管理 CLI 覆盖部署描述符
下面的步骤假设您已经有一个部署的应用程序
app.war,你想用 /home/user/web.xml 下的 web.xml 覆盖它的 WEB-INF/web.xml 文件。
- 添加一个部署重叠并添加内容。您可以以下列两种方式来进行:
使用 DRM 树
/deployment-overlay=myoverlay:add/deployment-overlay=myoverlay/content=WEB-INF\/web.xml:add(content={url=file:///home/user/web.xml})您可以用第二个语句添加更多的内容规则。
使用 convenience 模式
deployment-overlay add --name=myoverlay --content=WEB-INF/web.xml=/home/user/web.xml
- 链接这个重叠至部署归档。您可以以下列两种方式来进行:
使用 DRM 树
/deployment-overlay=myoverlay/deployment=app.war:add使用 convenience 模式
deployment-overlay link --name=myoverlay --deployments=app.war你必须指定用逗号隔开的多个归档名称。
请注意,部署归档并不需要存在于服务器上。您可以指定这个名称,但不将其链接到实际的部署。 重新部署应用程序
/deployment=app.war:redeploy

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.