3

With a fresh download of Groovy 2.1.9, I create:

// Test.Groovy
@Grab('commons-io:commons-io:1.2')
import org.apache.commons.io.CopyUtils
println "Resolved!"

Then I try running

$ ./groovy-2.1.9/bin/groovy Test.groovy

which fails with

General error during conversion: Error grabbing Grapes -- 
[download failed: commons-io#commons-io;1.2!commons-io.jar]

The artifact is listed in maven central, downloadable here

For what it's worth, various local files are created in:

~/.groovy/grapes/commons-io/commons-io

I'd very much appreciate ideas on how to debug or "resolve"!

Update

If I create a new user on my system (with no dotfiles in her homedir), this works. So I've got some user-specific config that's breaking things. I've tried deleting ~/.groovy, ~/.m2 and ~/.ivy to no avail. What else could it be?

M. Justin
  • 14,487
  • 7
  • 91
  • 130
Bosh
  • 8,138
  • 11
  • 51
  • 77
  • 1
    Groovy is the most indeterministic environment I've used in a long time... Did you ever solve the reason behind this problem? – Mark K Cowan Jul 05 '14 at 16:16

2 Answers2

1

Works for me. Not clear what's wrong...

$ groovy -Dgroovy.grape.report.downloads=true test
Resolving dependency: commons-io#commons-io;1.2 {default=[default]}
Preparing to download artifact commons-io#commons-io;1.2!commons-io.jar
Downloaded 64 Kbytes in 323ms:
  [SUCCESSFUL ] commons-io#commons-io;1.2!commons-io.jar (306ms)
Resolved!

To dig some more you can enable debug as follows:

groovy -Divy.message.logger.level=4 test
Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185
  • Adding a ~/.groovy/grapeConfig.xml seems to have helped -- but I can't figure out why the defaults weren't working (as they do when I create a new user). – Bosh Nov 15 '13 at 21:27
0

I am running Groovy 2.2.2 and have the same problem. I solved by deleting ~/.ivy2.

Wai Ho Leung
  • 36
  • 1
  • 4