由Grails创建的战争忽略图像文件

时间:2012-10-09 10:32:13

标签: grails war grails-2.0

我有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

为什么它表现如此......?如何解决这个问题?

1 个答案:

答案 0 :(得分:2)

如果您还没有找到答案,这种行为似乎已经为其他人提出了几次。从我发现的尝试到以下:

最少入侵 - 在`conf/BuildConfig.groovy添加以下内容:

compile ":webxml:1.4.1"

如果这不合适 - 请将以下内容放在conf/Config.groovy

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

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

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

中注释掉这一行
//runtime ":resources:1.1.6" 

这一切都来自Nabble

上的帖子