Plugins Grails Spock插件的ClassNotFoundException

Plugins Grails Spock插件的ClassNotFoundException,plugins,grails,spock,Plugins,Grails,Spock,我有一个Grails 1.3.7项目,但是当我安装Grails Spock插件时:我得到了这个: Installed plugin spock-0.5-groovy-1.7 to location /Users/tiffany/.grails/1.3.7/projects/grails-with-spock/plugins/spock-0.5-groovy-1.7. ... Resolving plugin JAR dependencies ... [Fatal Error] setti

我有一个Grails 1.3.7项目,但是当我安装Grails Spock插件时:我得到了这个:

    Installed plugin spock-0.5-groovy-1.7 to location /Users/tiffany/.grails/1.3.7/projects/grails-with-spock/plugins/spock-0.5-groovy-1.7. ...
Resolving plugin JAR dependencies ...
[Fatal Error] settings.xml:19:2: The markup in the document following the root element must be well-formed.
WARNING: Dependencies cannot be resolved for plugin [spock] due to error: The markup in the document following the root element must be well-formed.
Executing spock-0.5-groovy-1.7 plugin post-install script ...
Plugin spock-0.5-groovy-1.7 installed
   [delete] Deleting directory /Users/tiffany/Workspace/chrome-webstore/grails-with-spock/target/classes
   [delete] Deleting directory /Users/tiffany/.grails/1.3.7/projects/grails-with-spock/plugin-classes
   [delete] Deleting directory /Users/tiffany/.grails/1.3.7/projects/grails-with-spock/resources
当我尝试运行一个简单的域UnitSpec时,我得到了以下堆栈跟踪:

[Fatal Error] settings.xml:19:2: The markup in the document following the root element must be well-formed.
WARNING: Dependencies cannot be resolved for plugin [spock] due to error: The markup in the document following the root element must be well-formed.
Resolving dependencies...
Dependencies resolved in 1284ms.
Running script /Users/tiffany/dev/grails/scripts/TestApp.groovy
Environment set to test
    [mkdir] Created dir: /Users/tiffany/.grails/1.3.7/projects/grails-with-spock/plugin-classes
  [groovyc] Compiling 2 source files to /Users/tiffany/.grails/1.3.7/projects/grails-with-spock/plugin-classes
    [mkdir] Created dir: /Users/tiffany/Workspace/chrome-webstore/grails-with-spock/target/classes
  [groovyc] Compiling 7 source files to /Users/tiffany/Workspace/chrome-webstore/grails-with-spock/target/classes
Error executing script TestApp: java.lang.ClassNotFoundException: grails.plugin.spock.test.GrailsSpecTestType
java.lang.ClassNotFoundException: grails.plugin.spock.test.GrailsSpecTestType
    at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:391)
    at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
    at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
    at gant.Gant.withBuildListeners(Gant.groovy:427)
    at gant.Gant.this$2$withBuildListeners(Gant.groovy)
    at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
    at gant.Gant.dispatch(Gant.groovy:415)
    at gant.Gant.this$2$dispatch(Gant.groovy)
    at gant.Gant.invokeMethod(Gant.groovy)
    at gant.Gant.executeTargets(Gant.groovy:590)
    at gant.Gant.executeTargets(Gant.groovy:589)
Caused by: java.lang.ClassNotFoundException: grails.plugin.spock.test.GrailsSpecTestType
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at java_lang_ClassLoader$loadClass.call(Unknown Source)
    at _Events$_run_closure1_closure5.doCall(_Events.groovy:18)
    at _Events$_run_closure1.doCall(_Events.groovy:24)
    at _Events$_run_closure2.doCall(_Events.groovy:30)
    at _Events$_run_closure2.doCall(_Events.groovy)
    at _Events$_run_closure3.doCall(_Events.groovy:39)
    at org.apache.tools.ant.BuildListener$targetStarted.call(Unknown Source)
    at TestApp$_run_closure1.doCall(TestApp.groovy:82)
    at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
    ... 10 more
--- Nested Exception ---
java.lang.ClassNotFoundException: grails.plugin.spock.test.GrailsSpecTestType
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at java_lang_ClassLoader$loadClass.call(Unknown Source)
    at _Events$_run_closure1_closure5.doCall(_Events.groovy:18)
    at _Events$_run_closure1.doCall(_Events.groovy:24)
    at _Events$_run_closure2.doCall(_Events.groovy:30)
    at _Events$_run_closure2.doCall(_Events.groovy)
    at _Events$_run_closure3.doCall(_Events.groovy:39)
    at org.apache.tools.ant.BuildListener$targetStarted.call(Unknown Source)
    at TestApp$_run_closure1.doCall(TestApp.groovy:82)
    at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
    at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
    at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
    at gant.Gant.withBuildListeners(Gant.groovy:427)
    at gant.Gant.this$2$withBuildListeners(Gant.groovy)
    at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
    at gant.Gant.dispatch(Gant.groovy:415)
    at gant.Gant.this$2$dispatch(Gant.groovy)
    at gant.Gant.invokeMethod(Gant.groovy)
    at gant.Gant.executeTargets(Gant.groovy:590)
    at gant.Gant.executeTargets(Gant.groovy:589)

以前有人遇到过这个问题吗?如果是,我该如何解决这个问题?我尝试过谷歌搜索,但没有得到任何结果>许多问题都可以通过简单的
grails clean
解决,或者即使这样也无济于事,也可以尝试删除用户目录中的
.grails
文件夹,然后再次运行插件安装。

您要安装哪个版本?!0.4或0.5!我在一个空的项目中尝试了这两种方法,结果都成功了!!我安装了0.5-groovy-1.7btw版本,您使用的是什么grails版本?它不适用于我的grails1.3.7>。。而且效果很好!试着运行“grails插件列表”,看看是否安装了下面的插件!既然其他人已经确认在一个空项目中工作,那么就从一个空项目开始,并确保它适合您。如果不是,问题在于你的环境。如果是这样,这是一个特定于您的项目的问题,最好是逐步检查空项目与您的项目之间的差异…删除整个%USER\u PROFILE%/.grails文件夹有点太多,只需删除%USER\u PROFILE%/.grails/文件夹,这样,您就不必在构建应用程序时将所有依赖项重新下载到常春藤缓存文件夹中