Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Groovy - Grab - download failed

Tags:

groovy

I have a fresh installation of Groovy 2.1.4 and I'd like to create a script that uses HTTP builder.

I've added the following line at the top of the script:

@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.6') 

When I run the script in GroovyConsole, I get the following error:

1 compilation error:  Exception thrown VI 01, 2013 12:15:39 ODP. org.codehaus.groovy.runtime.StackTraceUtils sanitize  WARNING: Sanitizing stacktrace:  java.lang.RuntimeException: Error grabbing Grapes -- [download failed: commons-logging#commons-logging;1.1.1!commons-logging.jar]      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)      ... (aso) ...  java.lang.RuntimeException: Error grabbing Grapes -- [download failed: commons-logging#commons-logging;1.1.1!commons-logging.jar] 

When I run the following command on the Windows command line:

grape -V resolve org.codehaus.groovy.modules.http-builder http-builder 0.6 

I get the same error, i.e.:

:: problems summary :: :::: WARNINGS         [NOT FOUND  ] commons-logging#commons-logging;1.1.1!commons-logging.jar (0ms)      ==== localm2: tried        file:C:\Documents and Settings\Administrator/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar   :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS Error in resolve:     Error grabbing Grapes -- [download failed: commons-logging#commons-logging;1.1.1!commons-logging.jar] 

When I try to resolve commons-logging directly, via the following command:

grape -V resolve commons-logging commons-logging 1.1.1 

I get the same error, i.e. not found.

When I instead try to download the latest version, i.e. 1.1.3, via the appropriate command, it works. But even after that, resolving the http-client still fails.

Where's the problem?

like image 763
Dušan Rychnovský Avatar asked Jun 01 '13 10:06

Dušan Rychnovský


1 Answers

Try deleting ~/.m2 directory and also ~/.groovy/grapes directories.

It worked for me.

like image 61
Pavel Černocký Avatar answered Sep 29 '22 22:09

Pavel Černocký