我如何告诉ivy4r保持离线状态? [英] How do I tell ivy4r to stay offline?

查看:64
本文介绍了我如何告诉ivy4r保持离线状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们最近从Ant切换到Buildr以构建我们的项目.我们使用ivy4r Buildr扩展程序将Ivy用于依赖项管理.我们在办公室有一个本地存储库,可以用作公共工件的缓存,还可以在其中发布自己的工件.

We recently switched from Ant to Buildr for building our projects. We use Ivy for dependency management, using the ivy4r Buildr extension. We have a local repository at the office which is used as a cache for public artifacts and in which we also publish our own artifacts.

现在要解决的问题:当我无权访问Office存储库时,我希望能够构建我的项目. Buildr有一个标志来告诉它可以脱机工作(-o),但是ivy4r似乎没有考虑到这一点.有什么方法可以使常春藤不要尝试下载工件?我已经将它们全部保存在计算机的缓存中.

Now for the problem: I'd like to be able to build my project when I do not have access to the office repository. Buildr has a flag to tell it to work offline (-o), but ivy4r does not seem to take this into account. Is there any way to make Ivy not try to download artifacts? I have them all available in the cache on my machine already.

推荐答案

将缓存超时设置为永恒

您可以设置 cache 属性$ {ivy.cache.ttl.default}设为永恒,这将设置

Setting the cache timeout to eternal

You can set the cache property ${ivy.cache.ttl.default} to eternal this will set the TTL: so that the repository will not be checked for new revisions.

您可以通过使用以下参数调用ant来实现:

You could achieve this by calling ant with the following parameter:

ant -Divy.cache.ttl.default=eternal build

这来自文档:

为已解决的修订版缓存定义TTL(生存时间)规则.什么时候 Ivy解决了动态版本约束(例如latest.integration或 版本范围),它可以存储分辨率的结果(例如 在给定的时间(称为TTL)中,latest.integration = 1.5.1).代表着 常春藤将重复使用此动态修订解决方案结果,而无需 在TTL的持续时间内访问存储库,除非运行 在刷新模式下解决.

Defines a TTL (Time To Live) rule for resolved revision caching. When Ivy resolves a dynamic version constraint (like latest.integration or a version range), it can store the result of the resolution (like latest.integration=1.5.1) for a given time, called TTL. It means that Ivy will reuse this dynamic revision resolution result without accessing the repositories for the duration of the TTL, unless running resolve in refresh mode.

...

也可以将TTL持续时间设置为永恒",在这种情况下,一次 解决了该修订版始终使用的情况,但在刷新时除外 模式.

The TTL duration can also be set to 'eternal', in which case once resolved the revision is always use, except when resolving in refresh mode.

其他参考文献:

解决任务具有属性,可以用来

The resolve task has the attribute useCacheOnly, which can be used to

强制解析器仅使用其缓存,而不使用其实际缓存 内容

force[s] the resolvers to only use their caches and not their actual contents

示例:

<ivy:resolve file="path/to/ivy.xml" useCacheOnly="true/>

这篇关于我如何告诉ivy4r保持离线状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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