Groovy - Grab - 下载失败 [英] Groovy - Grab - download failed

查看:37
本文介绍了Groovy - Grab - 下载失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我全新安装了 Groovy 2.1.4,我想创建一个使用 HTTP 构建器的脚本.

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')

当我在 GroovyConsole 中运行脚本时,出现以下错误:

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]

当我在 Windows 命令行上运行以下命令时:

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 SettingsAdministrator/.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]

当我尝试通过以下命令直接解决 commons-logging 时:

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

grape -V resolve commons-logging commons-logging 1.1.1

我得到同样的错误,即not found.

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

当我尝试通过适当的命令下载最新版本,即 1.1.3 时,它可以工作.但即使在那之后,解析 http-client 仍然失败.

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.

问题出在哪里?

推荐答案

看起来您的 Grape 设置被设置为仅在您的本地 .m2 目录中查找库.检查您的 grapeConfig.xml 配置文件.(如果你没有,你可以创建它——它应该在你的 groovysh.historygrapes 缓存目录由 Groovy 创建的同一目录中.) 您可以复制 Groovy Grape 参考中显示的示例文件页.

It looks like your Grape settings are set only to look in your local .m2 directory for the library. Check your grapeConfig.xml configuration file. (If you don't have one, you can create it--it should go in the same directory where your groovysh.history and grapes cache directory are created by Groovy.) You can copy the example file shown on the Groovy Grape reference page.

如果这没有帮助,我会尝试删除您的 grapes 缓存目录,然后再试一次.

If that doesn't help, I would try deleting your grapes cache directory and try it again.

这篇关于Groovy - Grab - 下载失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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