我怎样才能包括其依赖的常春藤的依赖,没有? [英] How can I include the Ivy dependency and none of its dependencies?

查看:226
本文介绍了我怎样才能包括其依赖的常春藤的依赖,没有?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在关断时间在过去的几个星期试图让常春藤使用Ant去。我有它设置主要是,但我已经运行到与depenencies一个路障。

I have spent the last few weeks in off-time trying to get Ivy going with Ant. I have it set up mostly but I've run into a road-block with depenencies.

由于我使用Ant我曾与使用我的应用程序32个jar文件,一些内部,一些专有的(我已经添加了这两种类型的对我们的Nexus)和一些开源一个/ lib文件夹。然后我说32依赖行到我的ivy.xml文件。

Because I was using Ant I had a /lib folder with the 32 jar files that my app used, some in-house, some proprietary (I've added both of these types to our Nexus) and some Open Source. Then I added 32 dependency lines to my Ivy.xml file.

当我跑,我得到它试图拉下来的Nexus从这些文件的依赖地段,但我知道我不需要任何这些。所以,我想一个空<在每个依赖,因为这默认为*排除>标签,但这似乎包括依赖本身。有没有一种方法,我可以说排除这种依赖的所有依赖,但离开它??

When I run, I get it trying to pull down LOTS of dependencies of those files from Nexus but I know I don't need ANY of these. So I tried an empty <exclude> tag in each dependency as this defaults to *, but this seems to include the dependency itself. Is there a way I can say "Exclude all dependencies of this dependency but leave it"??

我住远离常春藤的唯一部分是配置的事情......我试着读了它几次,但......如果我的回答在那里,只是让我知道。谢谢你。

The only part of Ivy I've stayed away from is the "Config" thing... I've tried to read up on it several times but... if my answer's in there, just let me know. Thanks.

推荐答案

下面是一些关于这个论题previous答案:

Here's some previous answers on this topic:

  • IVY - Set the default transitive value
  • How to copy runtime libraries without the provided ones in IVY

最简单的办法是将传递属性添加到依赖性:

The simplest solution is to add the transitive attribute to the dependency:

<dependency org="foo" name="bar" revision="3.0" transitive="false"/>

如果您使用的是Maven仓库的Nexus一样,那么更好的解决方案是使用配置映射

If you're using a Maven repository like Nexus, then a better solution is to use a configuration mapping

<dependency org="foo" name="bar" revision="3.0" conf="default->master"/>

在常春藤配置是很难理解,最初,但值得努力。我希望下面的链接帮助:

Configurations in ivy are tough to understand, initially, but well worth the effort. I hope the following links help:

  • Ivy, what is the master configuration and why is it not pulling jvyaml?
  • How are maven scopes mapped to ivy configurations by ivy

这篇关于我怎样才能包括其依赖的常春藤的依赖,没有?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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