Skip to content

Instantly share code, notes, and snippets.

@lalyos
Last active October 1, 2021 16:24
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save lalyos/9366690 to your computer and use it in GitHub Desktop.
Save lalyos/9366690 to your computer and use it in GitHub Desktop.

Problem

When I started to play with geb in groovy shell.

You can pull the required dependencies via groovy grape as:

groovy.grape.Grape.grab([group:'org.gebish', module:'geb-core', version:'0.9.2'])
groovy.grape.Grape.grab([group:'org.seleniumhq.selenium', module:'selenium-chrome-driver', version:'2.37.1'])
groovy.grape.Grape.grab([group:'org.seleniumhq.selenium', module:'selenium-support', version:'2.37.1'])

but i faced the following error:

groovy:000> groovy.grape.Grape.grab([group:'org.seleniumhq.selenium', module:'selenium-chrome-driver', version:'2.37.1'])
ERROR java.lang.RuntimeException:
Error grabbing Grapes -- [download failed: cglib#cglib-nodep;2.1_3!cglib-nodep.jar]
        at groovysh_evaluate.run (groovysh_evaluate:2)

Solution

It turned out the the 2.1_3 version of cglib-nodep was removed from central maven repo. But luckily you can still find it in the ibiblio mirror. You can customize the list of maven reposed used by grape by creating a ~/.groovy/grapeConfig.xml file. You can download the fixxing version from this gist:

curl -o ~/.groovy/grapeConfig.xml https://gist.githubusercontent.com/lalyos/9366690/raw/grapeConfig.xml
<ivysettings>
<settings defaultResolver="downloadGrapes"/>
<resolvers>
<chain name="downloadGrapes">
<filesystem name="cachedGrapes">
<ivy pattern="${user.home}/.groovy/grapes/[organisation]/[module]/ivy-[revision].xml"/>
<artifact pattern="${user.home}/.groovy/grapes/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
</filesystem>
<!-- todo add 'endorsed groovy extensions' resolver here -->
<ibiblio name="codehaus" root="http://repository.codehaus.org/" m2compatible="true"/>
<ibiblio name="ibiblio" m2compatible="true"/>
<ibiblio name="java.net2" root="http://download.java.net/maven/2/" m2compatible="true"/>
<!-- this fixes the missing 2.1_3 version of cglib-nodep -->
<ibiblio name="mirror" root="http://mirrors.ibiblio.org/maven2/" m2compatible="true"/>
</chain>
</resolvers>
</ivysettings>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment