Grails 2.0.4 / 2.1.1 test-app抛出ClassNotFoundException(GrailsS​​pecTestType)

时间:2013-05-27 12:17:43

标签: grails spock

我有一个传统的grails应用程序,我的recentyl升级1.3.7 - > 2.0.4 将其升级到2.1.1

后会发生同样的事情

当我尝试从GGTS运行test-app时,我得到:

| Error Error executing script TestApp: java.lang.ClassNotFoundException: grails.plugin.spock.test.GrailsSpecTestType (Use --stacktrace to see the full trace)

4月份有SS site的类似报告。

我也看到有很多关于grails 1.3.7的类似例外的问题 - 但这是一个影响2.0.4的问题。

编辑:好的,它实际上也发生在命令行中,但至少我可以让它工作。 不幸的是,重新启动后再次破坏。

以下是我在控制台中修复它的方法,基本上我升级到0.7并降级到0.5-groovy-1.7

grails> clean
| Application cleaned.
grails> refresh-dependencies
| Dependencies refreshed.
grails> test-app
| Compiling 73 source files
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
| Compiling 119 source files

| Compiling 119 source files.
| Error Error running script test-app : java.lang.ClassNotFoundException: grails.plugin.spock.test.GrailsSpecTestType (U
se --stacktrace to see the full trace)
grails> install-plugin spock
| Resolving plugin spock. Please wait...
> You currently already have a version of the plugin installed [spock-0.5-groovy-1.7]. Do you want to update to [spock-0
.7]? [y,n] y
| Plugin installed.
grails> clean
| Application cleaned.
grails> refresh-dependencies
| Application cleaned.....
> You currently already have a version of the plugin installed [spock-0.7]. Do you want to update to [spock-0.5-groovy-1
.7]? [y,n] n
| Dependencies refreshed.
grails> test-app
> You currently already have a version of the plugin installed [spock-0.7]. Do you want to update to [spock-0.5-groovy-1
.7]? [y,n] n
| Compiling 73 source files
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
| Compiling 119 source files

| Compiling 119 source files.
| Error Error running script test-app : java.lang.ClassNotFoundException: grails.plugin.spock.test.GrailsSpecTestType (U
se --stacktrace to see the full trace)
grails> install-plugin spock
| Plugin 'spock' with version '0.7' is already installed
| Plugin not installed.
grails> uninstall-plugin spock
| Uninstalled plugin [spock]
grails> clean
| Application cleaned.
grails> refresh-dependencies
| Dependencies refreshed.
grails> test-app
| Compiling 73 source files
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
| Compiling 119 source files    
| Running 8 unit tests... 5 of 8

1 个答案:

答案 0 :(得分:1)

所以这显然是由一些行为不端的插件导致它的spock依赖引起的。 如果你的麻烦制造者是GWT,请采样解决方法:

compile(':gwt:0.8') {
exclude 'spock'
}

感谢Nathan Dunn