为什么Groovy / Grape不能解决Maven Central的工件问题? [英] Why won't Groovy/Grape resolve artifacts from Maven Central?

查看:397
本文介绍了为什么Groovy / Grape不能解决Maven Central的工件问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

然后我尝试运行

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



 转换过程中的一般错误:抓取错误葡萄 -  
[下载失败:commons-io# commons-io; 1.2!commons-io.jar]



工件是列出在maven central,可下载这里



这是值得的,各种本地文件创建在:



〜/ .groovy / grapes / commons-io / commons-io

我非常感谢关于如何调试或解决的想法!



更新



如果我在我的系统上创建一个新用户(在她的homedir中没有dotfiles),这个有效。所以我有一些用户特定的配置会破坏事情。我尝试删除〜/ .groovy 〜/ .m2 〜/。常春藤无济于事。还有什么可以做的?

解决方案

适合我。不清楚有什么问题......

  $ groovy -Dgroovy.grape.report.downloads = true test 
解析依赖关系:commons-io#commons-io; 1.2 {default = [default]}
准备下载工件commons-io#commons-io; 1.2!commons-io.jar
在323ms中下载64 KB:
[SUCCESSFUL] commons-io#commons-io; 1.2!commons-io.jar(306ms)
已解决!

若要进一步挖掘,您可以启用调试,如下所示:

  groovy -Divy.message.logger.level = 4 test 


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?

解决方案

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

这篇关于为什么Groovy / Grape不能解决Maven Central的工件问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆