Groovy   发布时间:2022-04-12  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Groovy – Grab – 下载失败大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个新的安装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 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]

当我尝试直接解决commons-logging时,@R_406_6749@:

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显示的示例文件

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

大佬总结

以上是大佬教程为你收集整理的Groovy – Grab – 下载失败全部内容,希望文章能够帮你解决Groovy – Grab – 下载失败所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。