Grails 2.3.8刷新依赖项

时间:2018-01-29 17:02:20

标签: grails

因为今天我在ggts中遇到了令人困惑的错误,同时刷新了依赖关系。我之前从未遇到过这个错误,它对我没有任何意义:

Command terminated with an exception: java.lang.Exception (see details for 
partial output)
Command: GrailsCommand(P/project> compile --non-interactive --refresh-
dependencies)
---- System.out ----
Loading Grails 2.3.8
.
|Environment set to development
.Error 
|
java.lang.NoClassDefFoundError: _GrailsClasspath_groovy$_run_closure1
Error |
at _GrailsClasspath_groovy.run(_GrailsClasspath_groovy:39)
Error |
at _GrailsClasspath_groovy$run.call(Unknown Source)
Error |
at   org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall
(CallSiteArray.java:45)
Error |
at _GrailsEvents_groovy$run.call(Unknown Source)
Error |
at org.codehaus.gant.IncludeTargets.leftShift(IncludeTargets.groovy:59)
Error |
at org.codehaus.gant.IncludeTargets$leftShift.call(Unknown Source)
Error |
at _GrailsEvents_groovy.run(_GrailsEvents_groovy:32)
Error |
at _GrailsEvents_groovy$run.call(Unknown Source)
Error |
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall
(CallSiteArray.java:45)
Error |
at _GrailsArgParsing_groovy$run.call(Unknown Source)
Error |
at org.codehaus.gant.IncludeTargets.leftShift(IncludeTargets.groovy:59)
Error |
at org.codehaus.gant.IncludeTargets$leftShift.call(Unknown Source)
Error |
at _GrailsArgParsing_groovy.run(_GrailsArgParsing_groovy:29)
Error |
at _GrailsArgParsing_groovy$run.call(Unknown Source)
Error |
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall 
(CallSiteArray.java:45)
Error |
at _GrailsInit_groovy$run.call(Unknown Source)
Error |
at org.codehaus.gant.IncludeTargets.leftShift(IncludeTargets.groovy:59)
Error |
at org.codehaus.gant.IncludeTargets$leftShift.call(Unknown Source)
Error |
at _GrailsInit_groovy.run(_GrailsInit_groovy:34)
Error |
at _GrailsInit_groovy$run.call(Unknown Source)
Error |
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall 
(CallSiteArray.java:45)
Error |
at _GrailsCompile_groovy$run.call(Unknown Source)
Error |
at org.codehaus.gant.IncludeTargets.leftShift(IncludeTargets.groovy:59)
Error |
at org.codehaus.gant.IncludeTargets$leftShift.call(Unknown Source)
Error |
at _GrailsCompile_groovy.run(_GrailsCompile_groovy:28)
Error |
at _GrailsCompile_groovy$run.call(Unknown Source)
Error |
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall 
(CallSiteArray.java:45)
Error |
at _GrailsSettings_groovy$run.call(Unknown Source)
Error |
at org.codehaus.gant.IncludeTargets.leftShift(IncludeTargets.groovy:59)
Error |
at org.codehaus.gant.IncludeTargets$leftShift.call(Unknown Source)
Error |
at Compile.run(Compile.groovy:25)
Error |
at Compile$run.call(Unknown Source)
Error |
at gant.Gant.prepareTargets(Gant.groovy:607)
Error |
at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeWithGantInstance 
(GrailsScriptRunner.java:769)
Error |
at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeScriptFile 
(GrailsScriptRunner.java:571)
Error |
at 
org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeScriptWithCaching 
(GrailsScriptRunner.java:470)
Error |
at 
org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeScriptWithCaching 
(GrailsScriptRunner.java:421)
Error |
at org.grails.ide.api.impl.GrailsConnectorImpl.executeCommand 
(GrailsConnectorImpl.java:160)
Error |
at org.grails.ide.eclipse.longrunning.process.GrailsProcess.run 
(GrailsProcess.java:130)
Error |
at org.grails.ide.eclipse.longrunning.process.GrailsProcess.main 
(GrailsProcess.java:93)
Error |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Error |
at sun.reflect.NativeMethodAccessorImpl.invoke 
(NativeMethodAccessorImpl.java:57)
Error |
at sun.reflect.DelegatingMethodAccessorImpl.invoke 
(DelegatingMethodAccessorImpl.java:43)
Error |
at java.lang.reflect.Method.invoke(Method.java:606)
Error |
at 

org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader 
(GrailsStarter.ja
va:235)
Error |
at  
org.codehaus.groovy.grails.cli.support.GrailsStarter.main 
(GrailsStarter.java:263)
---- System.err ----

我没有故意改变我项目的配置,不知道发生了什么。 我运行grails 2.3.8,java是1.7 如果有人知道该怎么做,请告诉我! 提前致谢

2 个答案:

答案 0 :(得分:0)

您的grails SDK和jdk配置正确吗?

您可以按照以下步骤操作:

  1. 转到项目目录e.g. d:\YourProject
  2. 导航到项目目录e.g. d:\YourProject\target\work
  3. 中的target \ work文件夹
  4. 删除工作文件夹

  5. 运行命令grails cleangrails compile

  6. 如果问题仍未解决:运行命令grails clean-all并右键单击GGTS中的项目,然后单击刷新依赖关系>下载

    希望它可以帮到你

答案 1 :(得分:0)