4

I'm trying to run geb using the grab examples in the user guide for pulling in dependencies:

$ cat my.groovy
@Grapes([
    @Grab("org.gebish:geb-core:0.9.2"),
    @Grab("org.seleniumhq.selenium:selenium-firefox-driver:2.26.0"),
    @Grab("org.seleniumhq.selenium:selenium-support:2.26.0")
])
import geb.Browser

Browser.drive{
    go "http://grails.org/plugins/"

}

However, the above code results in:

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
General error during conversion: Error grabbing Grapes -- [download failed: commons-codec#commons-codec;1.6!commons-codec.jar]

java.lang.RuntimeException: Error grabbing Grapes -- [download failed: commons-codec#commons-codec;1.6!commons-codec.jar]

Any help will be appreciated.

4

1 回答 1

3

它正在尝试获取该编解码器的旧版本……只需通过添加显式注释来强制使用新版本。在撰写本文时,我还更新了 selenium 依赖版本以针对我最新的 n 最大 FireFox v 29.0 运行:

@Grapes([
    @Grab("org.gebish:geb-core:0.9.2"),
    @Grab(group='commons-codec', module='commons-codec', version='1.9'),
    @Grab("org.seleniumhq.selenium:selenium-firefox-driver:2.41.0"),
    @Grab("org.seleniumhq.selenium:selenium-support:2.41.0")
])

当然,请确保您的机器上安装了 FireFox。

于 2014-05-09T16:06:25.453 回答