gpt4 book ai didi

grails - Grails 创建的 War 忽略图像文件

转载 作者:行者123 更新时间:2023-12-02 11:44:53 24 4
gpt4 key购买 nike

我有 grails 版本 2.0.4 。当我在本地运行我的应用程序时,它运行良好。

但是当我在 tomcat 服务器中进行生产部署时,它会运行,但会忽略/image 文件夹中的一些文件

我收到以下警告:

    resource.ResourceMeta While processing /css/main.css, a resource was required but not found: /images/skin/house.png
resource.ResourceMeta While processing /css/main.css, a resource was required but not found: /images/skin/house.png
resource.ResourceMeta While processing /css/main.css, a resource was required but not found: /images/skin/database_table.png
resource.ResourceMeta While processing /css/main.css, a resource was required but not found: /images/skin/database_add.png
resource.ResourceMeta While processing /css/main.css, a resource was required but not found: /images/skin/exclamation.png
resource.ResourceMeta While processing /css/main.css, a resource was required but not found: /images/skin/exclamation.png
resource.ResourceMeta While processing /css/main.css, a resource was required but not found: /images/skin/information.png
resource.ResourceMeta While processing /css/main.css, a resource was required but not found: /images/skin/sorted_asc.gif
resource.ResourceMeta While processing /css/main.css, a resource was required but not found: /images/skin/sorted_desc.gif
resource.ResourceMeta While processing /css/main.css, a resource was required but not found: /images/skin/cancel_icon.png
resource.ResourceMeta While processing /css/main.css, a resource was required but not found: /images/skin/cancel_icon.png
resource.ResourceMeta While processing /css/main.css, a resource was required but not found: /images/skin/database_delete.png
resource.ResourceMeta While processing /css/main.css, a resource was required but not found: /images/skin/database_edit.png
resource.ResourceMeta While processing /css/main.css, a resource was required but not found: /images/skin/database_save.png
resource.ResourceMeta While processing /css/main.css, a resource was required but not found: /images/skin/new_shadow.gif
resource.ResourceMeta While processing /css/main.css, a resource was required but not found: /images/skin/database_table.pn

为什么它的行为如此......?如何解决这个问题?

最佳答案

如果您还没有找到答案,那么这种行为似乎在其他人身上出现过几次。根据我的发现,请尝试以下操作:

侵入性最小 - 在您的 `conf/BuildConfig.groovy 中添加以下内容:

compile ":webxml:1.4.1"

如果不行 - 将以下内容放入您的 conf/Config.groovy

grails.resources.adhoc.excludes = ['**'] 

这更具侵入性,因为它禁用资源临时处理,但仍然保留安装的插件。

最后的手段 - 完全删除资源插件。注释掉 conf/BuildConfig.groovy

中的行
//runtime ":resources:1.1.6" 

这一切都来自 Nabble 上的一个线程

关于grails - Grails 创建的 War 忽略图像文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12798105/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com