解决阿帕奇常青藤依赖性时离线/断开? [英] Resolving Apache Ivy dependencies when offline/disconnected?
问题描述
我怎样才能常青藤解决依赖性(包括相关性改变=真正的
)从本地缓存时离线/断开?
How can I get Ivy to resolve dependencies (including dependencies with changing="true"
) from the local cache when offline/disconnected?
我的工作是使用Apache常春藤解析并下载第三方依赖一个基于Java的开源项目。该项目的的build.xml
已命名的Ant目标决心
的下载常春藤(如果需要),然后使用常春藤检索需要的jar。
I'm working on a Java-based open-source project that uses Apache Ivy to resolve and download 3rd party dependencies. The project's build.xml
has an ant target named resolve
that downloads Ivy (if needed) and then uses Ivy to retrieve the required jars.
一切都很正常时在线。然而,如果没有上网,蚂蚁决心
失败,即使需要的jar在当地常青藤缓存(〜/ .ivy2 /缓存
)。看来,常春藤尝试连接到Maven仓库刷新 =改变真正的
的依赖关系。
Everything works great when online. However, without Internet access, ant resolve
fails even if the required jars are in the local Ivy cache (~/.ivy2/cache
). It appears that Ivy is trying to connect to the Maven repository to refresh changing="true"
dependencies.
我得到的错误是类似以下内容:
The error I get is similar to the following:
[ivy:retrieve] You probably access the destination server through a proxy server that is not well configured.
[ivy:retrieve] You probably access the destination server through a proxy server that is not well configured.
[ivy:retrieve]
[ivy:retrieve] :: problems summary ::
[ivy:retrieve] :::: WARNINGS
[ivy:retrieve] Host repo.example.com not found. url=http://repo.example.com/exampleorg/examplename/examplerev/ivys/ivy.xml
[ivy:retrieve] Host repo.example.com not found. url=http://repo.example.com/exampleorg/examplename/examplerev/jars/examplename.jar
[ivy:retrieve] module not found: exampleorg#examplename;examplerev
[ivy:retrieve] ==== local: tried
[ivy:retrieve] ~/.ivy2/local/exampleorg/examplename/examplerev/ivys/ivy.xml
[ivy:retrieve] -- artifact exampleorg#examplename;examplerev!examplename.jar:
[ivy:retrieve] ~/.ivy2/local/exampleorg/examplename/examplerev/jars/examplename.jar
[ivy:retrieve] ==== shared: tried
[ivy:retrieve] ~/.ivy2/shared/exampleorg/examplename/examplerev/ivys/ivy.xml
[ivy:retrieve] -- artifact exampleorg#examplename;examplerev!examplename.jar:
[ivy:retrieve] ~/.ivy2/shared/exampleorg/examplename/examplerev/jars/examplename.jar
[ivy:retrieve] ==== repo: tried
[ivy:retrieve] http://repo.example.com/exampleorg/examplename/examplerev/ivys/ivy.xml
[ivy:retrieve] -- artifact exampleorg#examplename;examplerev!examplename.jar:
[ivy:retrieve] http://repo.example.com/exampleorg/examplename/examplerev/jars/examplename.jar
[ivy:retrieve] ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve] :: UNRESOLVED DEPENDENCIES ::
[ivy:retrieve] ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve] :: exampleorg#examplename;examplerev: not found
[ivy:retrieve] ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve]
[ivy:retrieve] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
BUILD FAILED
~/exampleproj/build.xml:123: impossible to resolve dependencies:
resolve failed - see output for details
运行蚂蚁-verbose决心
由预警提示打印输出中的以下行:
Running ant -verbose resolve
as suggested by the warning prints the following line in the output:
[ivy:retrieve] don't use cache for exampleorg#examplename;examplerev: changing=true
我怎样才能得到常春藤解析从何时脱机缓存变化=真正的
的依赖,而是继续查询库中的每个版本的时候上网吗?
How can I get Ivy to resolve changing="true"
dependencies from the cache when offline, but continue to query the repository each build when online?
推荐答案
开放式教育资源已经回答了这个问题,但不是很明显。
oers has answered the question, but it's not obvious.
尝试运行您的构建设置的 ivy.cache.ttl.default 在命令行属性:
Try running your build setting the ivy.cache.ttl.default property from the command-line:
ant -Divy.cache.ttl.default=eternal build
来源:
- IVY-879
- Ivy mailing list
这篇关于解决阿帕奇常青藤依赖性时离线/断开?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!