Install using grapes/grab fails partway through

932 views
Skip to first unread message

Chris Hermansen

unread,
Nov 2, 2016, 8:09:19 PM11/2/16
to Geb User Mailing List
Good people,

Taking my first steps with Geb and something is breaking when I try to install.

My Groovy version info: Groovy Version: 2.4.6 JVM: 1.8.0_111 Vendor: Oracle Corporation OS: Linux

My Groovy script that fails, in grab.groovy

@Grapes([
    @Grab("org.gebish:geb-core:1.0"),
    @Grab("org.seleniumhq.selenium:selenium-firefox-driver:3.0.1"),
    @Grab("org.seleniumhq.selenium:selenium-support:3.0.1")])

import geb.Browser


Here is what happens when I run it with groovy -Dgroovy.grape.report.downloads=true grab.groovy

Resolving dependency: org.seleniumhq.selenium#selenium-support;3.0.1 {default=[default]}
Resolving dependency: org.seleniumhq.selenium#selenium-firefox-driver;3.0.1 {default=[default]}
Resolving dependency: org.gebish#geb-core;1.0 {default=[default]}
Preparing to download artifact org.seleniumhq.selenium#selenium-support;3.0.1!selenium-support.jar
Preparing to download artifact org.seleniumhq.selenium#selenium-firefox-driver;3.0.1!selenium-firefox-driver.jar
Preparing to download artifact org.gebish#geb-core;1.0!geb-core.jar
Preparing to download artifact org.seleniumhq.selenium#selenium-remote-driver;3.0.1!selenium-remote-driver.jar
Preparing to download artifact junit#junit;4.12!junit.jar
Preparing to download artifact org.seleniumhq.selenium#selenium-api;3.0.1!selenium-api.jar
Preparing to download artifact cglib#cglib-nodep;3.2.4!cglib-nodep.jar
Preparing to download artifact org.apache.commons#commons-exec;1.3!commons-exec.jar
Preparing to download artifact com.google.code.gson#gson;2.3.1!gson.jar
Preparing to download artifact com.google.guava#guava;19.0!guava.jar
Preparing to download artifact org.apache.httpcomponents#httpmime;4.5.2!httpmime.jar
Preparing to download artifact net.java.dev.jna#jna-platform;4.1.0!jna-platform.jar
Preparing to download artifact org.apache.httpcomponents#httpclient;4.5.2!httpclient.jar
Preparing to download artifact org.apache.httpcomponents#httpcore;4.4.4!httpcore.jar
Preparing to download artifact commons-logging#commons-logging;1.2!commons-logging.jar
Preparing to download artifact commons-codec#commons-codec;1.9!commons-codec.jar
Preparing to download artifact net.java.dev.jna#jna;4.1.0!jna.jar
Preparing to download artifact org.hamcrest#hamcrest-core;1.3!hamcrest-core.jar
Preparing to download artifact org.codehaus.groovy#groovy-all;2.4.6!groovy-all.jar
Preparing to download artifact org.gebish#geb-ast;1.0!geb-ast.jar
Preparing to download artifact org.gebish#geb-waiting;1.0!geb-waiting.jar
Preparing to download artifact org.jodd#jodd-lagarto;3.7.1!jodd-lagarto.jar
Preparing to download artifact org.gebish#geb-implicit-assertions;1.0!geb-implicit-assertions.jar
Preparing to download artifact org.gebish#geb-exceptions;1.0!geb-exceptions.jar
Preparing to download artifact org.jodd#jodd-core;3.7.1!jodd-core.jar
Preparing to download artifact org.jodd#jodd-log;3.7.1!jodd-log.jar
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
General error during conversion: Error grabbing Grapes -- [download failed: commons-logging#commons-logging;1.2!commons-logging.jar]


followed by a stack trace which I did not include.

I hope someone has a suggestion for me!  Thanks very much in advance.

Chris Hermansen

unread,
Nov 3, 2016, 1:06:32 PM11/3/16
to Geb User Mailing List
Sorry I hope it's OK to post a response to myself!

I found no solution to this using Grapes but all seems to work OK using the gradle alternative.  For reference / in case anyone is interested:
  1. I installed gradle (using SDKMAN)
  2. initialized the working directory using gradle init --type=groovy-library
  3. added the three lines mentioned in The Book of Geb to my build.gradle file, with version 3.0.1 instead of 2.52.0
  4. ran gradle build
  5. success.

Marcin Erdmann

unread,
Nov 3, 2016, 5:45:29 PM11/3/16
to Geb User Mailing List
Hi Chris,

Groovy doesn't like when it's itself pulled in through grapes. Given that Geb depends on Groovy it will be pulled in transitively unless you exclude it like this:

@Grapes([
    @Grab("org.gebish:geb-core:1.0"),
    @Grab("org.seleniumhq.selenium:selenium-firefox-driver:3.0.1"),
    @Grab("org.seleniumhq.selenium:selenium-support:3.0.1"),
    @GrabExclude("org.codehaus.groovy:groovy-all")])

import geb.Browser

Marcin 

--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+unsubscribe@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/12d75df1-a81a-4825-8631-400f9321ed9f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

chris hermansen

unread,
Nov 3, 2016, 7:53:48 PM11/3/16
to geb-...@googlegroups.com
Marcin and list,

On Thu, Nov 3, 2016 at 2:45 PM, Marcin Erdmann <marcin....@proxerd.pl> wrote:
Hi Chris,

Groovy doesn't like when it's itself pulled in through grapes. Given that Geb depends on Groovy it will be pulled in transitively unless you exclude it like this:

@Grapes([
    @Grab("org.gebish:geb-core:1.0"),
    @Grab("org.seleniumhq.selenium:selenium-firefox-driver:3.0.1"),
    @Grab("org.seleniumhq.selenium:selenium-support:3.0.1"),
    @GrabExclude("org.codehaus.groovy:groovy-all")])

import geb.Browser

Marcin 

Marcin, thank you very much for the suggestion; unfortunately, I don't see any improvement in the results.  Here's the code as per your suggestion, in file "grab.groovy":

@Grapes([
    @Grab("org.gebish:geb-core:1.0"),
    @Grab("org.seleniumhq.selenium:selenium-firefox-driver:3.0.1"),
    @Grab("org.seleniumhq.selenium:selenium-support:3.0.1"),
    @GrabExclude("org.codehaus.groovy:groovy-all")])
import geb.Browser

And here's what happens when I "groovy grab.groovy":

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

java.lang.RuntimeException: Error grabbing Grapes -- [download failed: commons-logging#commons-logging;1.2!commons-logging.jar]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

more traceback deleted...

This is a very similar traceback to the one received without first including the GrabExclude directive.

--
You received this message because you are subscribed to a topic in the Google Groups "Geb User Mailing List" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/geb-user/SUOG-BiEiE4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to geb-user+unsubscribe@googlegroups.com.

To post to this group, send email to geb-...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Chris Hermansen · clhermansen "at" gmail "dot" com

C'est ma façon de parler.

Marcin Erdmann

unread,
Nov 5, 2016, 9:38:38 AM11/5/16
to Geb User Mailing List
Sorry, You still need that @GrabExclude but I should have read the stacktrace in full before responding to understand what the exact issue is.

I've noticed that when the download fails for on of the commons artefacts (which usually don't have dependencies themselves which means that they are the first artefacts to be downloaded) there's either an issue with your connection (which doesn't seem to be the case because you were able to resolve the same dependencies using Gradle) or with local maven repository which is used by @Grab to cache artifacts. It will sound like a drastic thing to do but I remember that dropping the .m2 directory helped when I had an issue which manifested in the same way.

chris hermansen

unread,
Nov 7, 2016, 5:33:28 PM11/7/16
to geb-...@googlegroups.com
Marcin and list,

Thanks for that tip on the .m2 directory; I also deleted my .groovy/grapes cache and got the latest groovy (2.4.7).

That got me past my problem with the commons-logging.jar file but now I'm getting kicked by the mozilla gecko driver...

Apparently there is a known problem with respect to the version 3.0.1 code, see for example

   http://stackoverflow.com/questions/40080077/selenium-3-firefox-click-not-working/40432678

So I am back to version 2.52 and things now seem to be working!

So thanks very very much for your help!


For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages