groovy - Geb-core 3.2 与 groovy 2.5.8 冲突
问题描述
我尝试将最后一个 groovy 2.5.8 与 geb-core 3.2 一起使用。
例如
@Grapes([
@Grab("org.gebish:geb-core:3.2"),
@Grab("org.seleniumhq.selenium:selenium-firefox-driver:3.141.59"),
@Grab("org.seleniumhq.selenium:selenium-support:3.141.59")
])
import geb.Browser
browser = new Browser()
println "Hello from test"
它是生成错误
C:\PROJ\bitb\checkBoard\test>groovy runTest.groovy org.codehaus.groovy.control.MultipleCompilationErrorsException:启动失败:转换期间出现一般错误:模块版本冲突。模块 [groovy-xml 在 2.5.8 版本中加载,您正在尝试加载 2.5.6 版本
如果我将 geb-core 更改为 2.3.1 它运行良好。也许我应该改变一些配置?
提前致谢!
解决方案
Geb 依赖于 Groovy,但在运行脚本时您已经加载了 Groovy - 您需要获取排除 Groovy 模块:
@Grapes([
@Grab("org.gebish:geb-core:3.2"),
@Grab("org.seleniumhq.selenium:selenium-firefox-driver:3.141.59"),
@Grab("org.seleniumhq.selenium:selenium-support:3.141.59"),
@GrabExclude("org.codehaus.groovy:groovy-all")
])
推荐阅读
- php - 使用 curl_multi_init 并行处理多个 curl 请求
- mysql - SUM 列的最小值和最大值
- html - 如何在 React Material UI 表中的 Box 中换行?
- django - 以模型形式访问外来对象的多对多关系作为多项选择
- python - 从外部包/文件夹导入包/脚本
- xml - 如何在 XSL 中获取边元素?
- emacs - 为 Emacs 滚动你自己的图形数据库
- python - sklearn cross_validate() 函数在传递 fit_params 时中断
- ios - 在 Flutter 上构建时,有没有办法在 Visual Studio Code 中添加 Xcode Build 的任务号和当前任务
- microsoft-graph-api - 使用 Graph API 获取团队的频道不可靠