将自定义的urlrewriterules.xml和domainsplittings.xml文件添加到“ staticfiles \ share \ system \ config \ cluster \”文件夹中的盒式磁带后,我们将不再执行deployServer gradle任务。任务失败,并出现以下错误:
* What went wrong:
Execution failed for task ':init_project:deployShareFiles'.
> Could not deploy files of task :init_project:deployShareFiles
> Task :init_project:deployShareFiles: Resource 'C:\Work\Project\intershop-ci\sources\projects\webshop\build\server\share\system\config\cluster\domainsplittings.xml' already defined for Task :bc_urlrewrite:deployShareFiles
> Task :init_project:deployShareFiles: Resource 'C:\Work\Project\intershop-ci\sources\projects\webshop\build\server\share\system\config\cluster\urlrewriterules.xml' already defined for Task :bc_urlrewrite:deployShareFiles
有人知道为什么吗?我们如何添加自己的url重写规则,而无需在deployServer之后每次都编辑这些文件(从bc_urlrewrite盒中复制系统规则)?
谢谢您的回答!
答案 0 :(得分:3)
请查看Cookbook - Deployment Tools ICM 7.x / 23 Recipe: Replace a File Deployed by Another Component:
替换文件是一种严厉的措施。考虑使用内容过滤器来更改现有文件,而不要提供自己的版本,因为这样可以简化将来的迁移。
您似乎无法使用配置框架的特定于环境的文件来重载$IS_SHARE/system/config/cluster/domainsplittings.xml
和$IS_SHARE/system/config/cluster/urlrewriterules.xml
文件(通过固定路径加载,而不是通过配置框架加载)。
该错误表明两个不同的组件(bc_urlrewrite
与init_project
)正在尝试部署相同的目标文件。您有两种选择:
bc_urlrewrite
的部署中排除文件来解决冲突(提供自定义部署逻辑),请参阅:Cookbook - Deployment Tools ICM 7.x / 14 Recipe: Provide Custom Deployment Configuration and Logic