使用基于angular-template-asset-pipeline的自定义AssetFile时出现Grails war包装错误

时间:2017-04-26 19:43:12

标签: grails asset-pipeline grails-plugin grails-2.5

在Grails 2.5.6项目中,我无法为Angular模板处理编写自定义资产管道AssetFile / Processor对。更具体地说,它在我以开发模式(grails run-app)运行时有效,但在打包时失败(grails war)。

新的AssetFile是angular-template-asset-pipeline 2.2.7的简单定制(我需要使用仅在插件的新版本上添加的新参数,仅适用于Grails 3)。

供参考,以下是文件:

我在Bootstrap.groovy上添加了以下代码:

if (!AssetHelper.assetSpecs.contains(AngularTemplateAssetFile)) {
    AssetHelper.assetSpecs << AngularTemplateAssetFile
}
_Events.groovy上的

eventAssetPrecompileStart = { assetConfig ->
    assetConfig.specs << 'vtp.angular.AngularTemplateAssetFile'
}

grails run-app上正确调用处理器,并处理角度模板并将其注入页面。在grails run-war上,我收到以下错误:

 ...
.
|Compiling 7 GSP files for package [vtpWeb]
..
|Compiling 2 GSP files for package [springSecurityCore]
.
|Compiling 8 GSP files for package [jodaTime]
.
|Compiling 4 GSP files for package [mail]
.
|Compiling 1 GSP file for package [greenmail]
.
|Compiling 5 GSP files for package [console]
..
|Building WAR file
...................................................................................................
|Precompiling Assets!
.Error
|
WAR packaging error: vtp.angular.AngularTemplateAssetFile

该消息只包含类名,我无法弄清楚如何在构建战争时调试应用程序。

使用的版本:

  • Grails 2.5.6
  • asset-pipeline:2.6.7
  • angular-template-asset-pipeline的原始版本用作我的fork的基础:2.2.7

0 个答案:

没有答案