加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

Groovy – Grab – 下载失败

发布时间:2020-12-14 16:38:47 所属栏目:大数据 来源:网络整理
导读:我有一个新的安装Groovy 2.1.4,我想创建一个使用HTTP构建器的脚本。 我在脚本的顶部添加了以下行: @Grab(group='org.codehaus.groovy.modules.http-builder',module='http-builder',version='0.6') 当我在GroovyConsole中运行脚本时,我会收到以下错误信息
我有一个新的安装Groovy 2.1.4,我想创建一个使用HTTP构建器的脚本。

我在脚本的顶部添加了以下行:

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

当我在GroovyConsole中运行脚本时,我会收到以下错误信息:

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命令行上运行以下命令时:

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

我得到相同的错误,即:

:: 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时,通过以下命令:

grape -V resolve commons-logging commons-logging 1.1.1

我得到相同的错误,即找不到。

当我试图通过适当的命令下载最新版本,即1.1.3,它是有效的。但即使这样,解决http-client仍然失败。

问题在哪里?

解决方法

看起来您的Grape设置只能设置为您的本地.m2目录库。检查您的grapeConfig.xml配置文件。 (如果没有,可以创建它 – 它应该在Groovy创建groovysh.history和grapes缓存目录的同一目录中。)您可以复制 the Groovy Grape reference page上显示的示例文件。

如果没有帮助,我会尝试删除您的葡萄缓存目录并再次尝试。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读