一种使用Ivy控制上游依赖关系的依赖关系范围的方法吗? [英] A way to control dependencies ranges for upstream dependencies using Ivy?

查看:61
本文介绍了一种使用Ivy控制上游依赖关系的依赖关系范围的方法吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Ivy从内部开发的第三方库组装一个复合应用程序. Ivy用于管理用于构建上述库的依赖项.对于每个库,都有多个可用的兼容版本,这些版本可以在组合应用程序中使用.问题是我如何指示常春藤不要选择依赖的最新版本.让我用以下示例进行说明:

I am using Ivy to assemble a composite application from internally developed and third party libraries. Ivy is used to manage dependencies for building the above libraries. For each library there are multiple compatible versions that are available and that may be used within the assembled application. The question is how can I direct ivy NOT to choose the latest version of a dependency. Let me illustrate with the following example:

  • A [3]:B [2.5.+],C [1.3.+]

表示软件包A依赖于任何版本2.5.0-2.5.X的B软件包(在2.5分支内没有重大更改,这意味着该范围内的所有版本都是兼容的).相同的逻辑适用于C.

meaning that package A depends on the B package of any version 2.5.0-2.5.X (within 2.5 branch there are no breaking changes, which means all versions within that range are compatible). Same logic applies to C.

在应用程序组装时,我定义一个简单的Ivy.xml文件:

At application assembly time I define an Ivy.xml file that simply says:

  • 应用程序:A [3]

这将指示Ivy在A兼容的范围内提取B和C的所有最新版本.由于某些业务限制,我还想说":而不是使用定义的范围中的B的最新版本,而应使用版本2.5.6"(假设还存在2.5.7).因此,我想说的不是上面的内容:

This will instruct Ivy to extract all the latest versions of B and C in the ranges that A is compatible with. Due to some business constraints I want to also "say": "instead of the latest version of B in the defined range use version 2.5.6 specifically" (let's say that 2.5.7 also exists). So, instead of above I want to say something like:

  • 应用程序:A [3],B [2.5.6]

问题在于常春藤将B [2.5.6]驱逐出2.5.7.因此,必须使用某种冲突管理器.我正在考虑最新兼容,希望它可以指定其他范围.我找不到一个例子.那当然是因为我的猜测是正确的...

The problem is that Ivy will evict B[2.5.6] in favor of 2.5.7. So a conflict manager of some sort will have to be used. I was thinking of latest-compatible with hope that it would allow specify an additional range. I cannot find an example of that. That is given that my guess is correct, of course...

推荐答案

The force attribute on the dependency declaration may be all you need.

如果这不起作用,建议您阅读有关冲突管理的常春藤文档:

If that doesn't work, I'd suggest reading the ivy documentation on conflict management:

  • http://ant.apache.org/ivy/history/latest-milestone/ivyfile/conflicts.html
  • http://ant.apache.org/ivy/history/latest-milestone/settings/conflict-managers.html

这篇关于一种使用Ivy控制上游依赖关系的依赖关系范围的方法吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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