我有我的 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'
}
}
有人处理过同样的情况吗?