I am trying to run a simple Groovy script that utilizes Geb to fetch a title. However, I receive an error:
Module [groovy-xml is loaded in version 4.0.2 and you are trying to load version 3.0.8
I user Groovy version 4.02. GROOVY_HOME is set; I installed Groovy via sdkman.
$ groovy -version
Groovy Version: 4.0.2 JVM: 17.0.3 Vendor: Amazon.com Inc. OS: Linux
$ java -version
openjdk version "17.0.3" 2022-04-19 LTS
// @Grab(group='org.gebish', module='geb-core', version='5.1')
@Grapes([
@Grab("org.gebish:geb-core:5.1"),
@Grab("org.seleniumhq.selenium:selenium-firefox-driver:3.141.59"),
@Grab("org.seleniumhq.selenium:selenium-support:3.141.59")
])
import geb.Browser
Browser.drive {
go "http://example.com"
println title
}
How to fix this?