2

我有一个旧的 grails 应用程序,我最近升级了 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)

SS 网站4 月有类似的报道。

我还看到有很多关于 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
4

1 回答 1

1

So this is apparently caused by some misbehaving plugin exporting it's spock dependency. Sample workaround if your troublemaker is GWT:

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

Thanks to Nathan Dunn

于 2013-06-11T23:25:39.417 回答