ivy - 我如何告诉 ivy4r 保持离线状态?

标签 ivy buildr

我们最近从 Ant 切换到 Buildr 来构建我们的项目。我们使用 Ivy 进行依赖管理,使用 ivy4r Buildr 扩展。我们在办公室有一个本地存储库,用作公共(public)工件的缓存,我们也在其中发布我们自己的工件。

现在问题来了:我希望能够在无法访问 office 存储库的情况下构建我的项目。 Buildr 有一个标志告诉它离线工作(-o),但 ivy4r 似乎没有考虑到这一点。有没有办法让 Ivy 不尝试下载工件?我已经在我的机器上的缓存中提供了它们。

最佳答案

将缓存超时设置为永恒

您可以设置 cache属性 ${ivy.cache.ttl.default} 为 eternal 这将设置 TTL : 这样就不会检查存储库是否有新的修订。

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

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

这是来自 documentation :

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.

...

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.

其他引用:

为解析任务设置 UseCacheOnly

resolve task具有属性 useCacheOnly,可用于

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

例子:

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

关于ivy - 我如何告诉 ivy4r 保持离线状态?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6971517/

相关文章:

java - Ivy 使用 Maven 快照 "revision already resolved"

java - Maven POM 对 ivy.xml 文件的依赖

java - buildr 构建已中止 - 无法从存储库下载

java - 我将 Builder 集成测试放在哪里?

android - 使用 apache buildr 构建 android apk

java - 如何让 Ivy 从 Nexus 仓库下载源代码

spring - Tomcat 的 javax.servlet 与 Apache Ivy 问题的解决依赖关系

ruby - 帮助评估构建工具

grails - 无法从Grails应用程序中排除httpcomponents jar

maven-2 - 我如何找出 Apache Buildr/Maven 2 存储库名称