常春藤缓存的依赖关系文件,但不能复制到我的lib [英] Ivy cached a dependency file, but not copy to my lib

查看:149
本文介绍了常春藤缓存的依赖关系文件,但不能复制到我的lib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个奇怪的问题。我加了番石榴我的ivy.xml如下:

I got a strange problem. I added Guava to my ivy.xml as the following:

<dependency org="com.google.guava" name="guava" rev="14.0.1" conf="test"/>

当我运行蚂蚁,我可以看到它的解决:

When I run ant, I can see it's resolved:

[ivy:retrieve]  found com.google.guava#guava;14.0.1 in default

和我能找到在〜/ .ivy2 /缓存中的文件。但它并没有被复制到我的lib目录下。

And I can find the file in the ~/.ivy2/cache. But it didn't get copied to my lib directory.

其他的依赖都没有问题....有什么建议?谢谢你。

Other dependencies have no problem....Any advice? Thanks.

推荐答案

指定在配置映射的ivy.xml

我有同样的问题,并不能为我的生命找出其中的依赖性已下载到。常春藤似乎表明它被下载,并有高速缓存中的某些条目,但什么也没有出现在我的/ lib目录下。

I had the same problem and couldn't for the life of me figure out where the dependencies were downloaded to. Ivy seemed to suggest it was downloaded, and there were some entries in the cache, but nothing was appearing in my /lib.

---------------------------------------------------------------------
|                  |            modules            ||   artifacts   |
|       conf       | number| search|dwnlded|evicted|| number|dwnlded|
---------------------------------------------------------------------
|      compile     |   2   |   2   |   2   |   0   ||   0   |   0   |
---------------------------------------------------------------------

但是,当我看到这个回答的一切都变了。

的ivy.xml ,你必须指定配置映射 CONF =myconfig-&GT;默认 ,关键是 - &GT;默认

In ivy.xml, you have to specify the configuration mapping conf="myconfig->default", the key being ->default

<configurations>
    <conf name="myconfig" description="Required for JSF"/>
</configurations>

<dependencies>
    <dependency conf="myconfig->default" name="jsf-api" org="com.sun.faces" rev="2.2.13"/>          
</dependencies>

这将映射用户定义的配置,一个Maven范围(准确的说,在默认范围)。在实践中,您将只使用两种默认范围(的来源)。

This will map your user-defined configuration to a Maven scope (to be exact, the default scope). In practice, you will only use either default or master scope (source).

请参阅:

  • Official description: http://ant.apache.org/ivy/history/2.2.0/ivyfile/configurations.html
  • IMHO a clearer explanation: http://wrongnotes.blogspot.sg/2014/02/simplest-explanation-of-ivy.html
  • This answer discusses maven scopes other than default: http://stackoverflow.com/a/7116577/4212710

我的直觉是,如果你是指向一个Maven仓库这仅仅是必需的。我没有尝试过其他。

My gut feel is that this is only required if you are pointing to an Maven repository. I have not tried otherwise.

如果你已经做到了这一点,它仍然不下载,也许@ javabrett的回答可以提供帮助。

If you have already done this and it still does not download, perhaps @javabrett's answer can help.

这篇关于常春藤缓存的依赖关系文件,但不能复制到我的lib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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