Abu*_*iam 1 groovy jar ruby-grape dependency-management apache-httpclient-4.x
我想编写一个使用Apache HttpClient 4.1的简单Groovy脚本,因为我没有它的jar,我想用Grapes抓住它.到目前为止我在剧本中的所有内容都是......
@Grab(group='org.apache.httpcomponents', module='httpclient', version='4.0')
import org.apache.http.impl.client.DefaultHttpClient;
Run Code Online (Sandbox Code Playgroud)
但是当我运行这个时,我得到一个例外..
java.lang.RuntimeException: Error grabbing Grapes -- [download failed: commons-logging#commons-logging;1.1.1!commons-logging.jar]
Run Code Online (Sandbox Code Playgroud)
当我只询问http客户端时,为什么Grapes得到公共记录?如果是因为后者需要前者,那么我是否需要自己明确地获取所有依赖的http客户端jar?我怎么会知道它们是什么?有没有办法告诉Grapes自己做这件事?
发生这种情况是因为commons-logging是一个传递依赖,即org.apache.httpcomponents的依赖:httpclient.
您可能有一个问题,因为你的本地Maven回购不具有共享记录,不知道如何(或不配置),以寻找它.
| 归档时间: |
|
| 查看次数: |
121 次 |
| 最近记录: |