我的grails应用程序使用 lesscss-resources 插件(v 1.3.0.3)。我还想使用 yui-minify-resources 插件(v.0.1.5)。 我使用以下方法安装了插件:
grails install-plugin yui-minify-resources
但是现在当我尝试启动应用程序时,我有一个例外:
2012-10-15 12:58:48,901 ERROR org.codehaus.groovy.grails.plugins.DefaultGrailsPluginManager - Error configuring dynamic methods for plugin [resources:1.1.6]: java.lang.NoSuchMethodError: org/mozilla/javascript/Parser.parse(Ljava/io/Reader;Ljava/lang/String;I)Lorg/mozilla/javascript/ScriptOrFnNode;
org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoSuchMethodError: org/mozilla/javascript/Parser.parse(Ljava/io/Reader;Ljava/lang/String;I)Lorg/mozilla/javascript/ScriptOrFnNode;
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NoSuchMethodError: org/mozilla/javascript/Parser.parse(Ljava/io/Reader;Ljava/lang/String;I)Lorg/mozilla/javascript/ScriptOrFnNode;
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:312)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.<init>(JavaScriptCompressor.java:533)
at com.blockconsult.yuiminifyresources.YuiJsMinifyResourceMapper$_map_closure1.doCall(YuiJsMinifyResourceMapper.groovy:29)
at com.blockconsult.yuiminifyresources.YuiJsMinifyResourceMapper.map(YuiJsMinifyResourceMapper.groovy:28)
at org.grails.plugin.resource.mapper.ResourceMapper.invoke(ResourceMapper.groovy:139)
at org.grails.plugin.resource.mapper.ResourceMapper.invokeIfNotExcluded(ResourceMapper.groovy:128)
at org.grails.plugin.resource.ResourceProcessor.applyMappers(ResourceProcessor.groovy:587)
at org.grails.plugin.resource.ResourceProcessor.prepareResource(ResourceProcessor.groovy:533)
at org.grails.plugin.resource.ResourceProcessor$_prepareSingleDeclaredResource_closure12.doCall(ResourceProcessor.groovy:602)
at org.grails.plugin.resource.util.ResourceMetaStore.addDeclaredResource(ResourceMetaStore.groovy:29)
at org.grails.plugin.resource.ResourceProcessor.prepareSingleDeclaredResource(ResourceProcessor.groovy:600)
at org.grails.plugin.resource.ResourceProcessor$_prepareResourceBatch_closure14.doCall(ResourceProcessor.groovy:625)
at org.grails.plugin.resource.ResourceProcessorBatch.each(ResourceProcessorBatch.groovy:8)
at org.grails.plugin.resource.ResourceProcessor.prepareResourceBatch(ResourceProcessor.groovy:621)
at org.grails.plugin.resource.ResourceProcessor.resourcesChanged(ResourceProcessor.groovy:804)
at org.grails.plugin.resource.ResourceProcessor.loadModules(ResourceProcessor.groovy:800)
at org.grails.plugin.resource.ResourceProcessor.reloadAll(ResourceProcessor.groovy:1056)
at ResourcesGrailsPlugin$_closure3.doCall(ResourcesGrailsPlugin.groovy:172)
... 5 more
我认为我有这个错误,因为(文档说明)YUI minify使用替代版本的Rhino,这是lesscss资源插件的依赖。
我试图驱逐依赖,但只是尝试'因为它似乎不起作用
这是我的 Config.groov :
plugins{
compile (":lesscss-resources:1.3.0.3"){
excludes 'rhino:1.7R3'
}
}
有人管理过同样的情况吗?
答案 0 :(得分:1)
我已修复此问题,将rhino依赖项直接放在lib文件夹中。您可以从https://developer.mozilla.org/en-US/docs/Rhino/Download_Rhino
下载