gpt4 book ai didi

ant - 在 Ant 中设置 Ivy 主目录

转载 作者:行者123 更新时间:2023-12-04 11:44:08 25 4
gpt4 key购买 nike

我想将 ivy.default.ivy.user.dir 设置为默认值以外的其他内容 ${user.home}/.ivy2 .我可以在命令行上使用
ant -Divy.default.ivy.user.dir=${WORKSPACE}/IVYCACHE .但是,我想在没有命令行参数的情况下设置它。我曾尝试在 build.xml、common.xml 和 ivysettings.xml 中设置此属性。奇怪的是,它似乎将默认缓存设置为该路径,但详细的输出表明 user.dir 没有默认设置,因此它使用了 ${user.home}/.ivy2小路。

这是我在 build.xml 文件中设置 user.dir 时的输出。
奇怪的是,它将默认缓存设置为我用于 user.dir 的路径

[ivy:buildlist] No ivy:settings found for the default reference 'ivy.instance'.  A default instance will be used[ivy:buildlist] Loading jar:file:/usr/local/ant/lib/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivy.properties[ivy:buildlist] searching settings file: trying /home/hudson/.hudson/jobs/Next_CI/workspace/ivysettings.xml[ivy:buildlist] searching settings file: trying /home/hudson/.hudson/jobs/Next_CI/workspace/ivyconf.xml[ivy:buildlist] searching settings file: trying ivysettings.xml[ivy:buildlist] searching settings file: trying ivyconf.xml[ivy:buildlist] no settings file found, using default...[ivy:buildlist] :: Ivy 2.2.0 - 20100923230623 :: http://ant.apache.org/ivy/ ::[ivy:buildlist] jakarta commons httpclient not found: using jdk url handling[ivy:buildlist] :: loading settings :: url = jar:file:/usr/local/ant/lib/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivysettings.xml[ivy:buildlist] including url: jar:file:/usr/local/ant/lib/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivysettings-public.xml[ivy:buildlist] no default cache defined: set to /home/hudson/.hudson/jobs/Next_CI/workspace/ivy2/cache[ivy:buildlist] including url: jar:file:/usr/local/ant/lib/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivysettings-shared.xml[ivy:buildlist] including url: jar:file:/usr/local/ant/lib/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivysettings-local.xml[ivy:buildlist] including url: jar:file:/usr/local/ant/lib/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivysettings-main-chain.xml[ivy:buildlist] including url: jar:file:/usr/local/ant/lib/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivysettings-default-chain.xml[ivy:buildlist] settings loaded (71ms)[ivy:buildlist]         default cache: /home/hudson/.hudson/jobs/Next_CI/workspace/ivy2/cache

Then later, it claims that user.dir is not set anywhere.resolve:

[ivy:resolve] Loading jar:file:/usr/local/ant/lib/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivy.properties[ivy:resolve] jakarta commons httpclient not found: using jdk url handling[ivy:resolve] :: loading settings :: file = /home/hudson/.hudson/jobs/Next_CI/workspace/common/ivysettings.xml[ivy:resolve] no default ivy user dir defined: set to /home/hudson/.ivy2

Here is my build.xml line:

<property name="ivy.default.ivy.user.dir" value="${basedir}/ivy2" />

我曾尝试将此行添加到 common/ivysettings.xml 和 common/common.xml 中,但没有成功。

最佳答案

我添加了您在示例中指定的确切行 build.xml在 Ivy 二进制下载中提供,可以看到在 ivy2 中下载的工件samples 中的子文件夹文件夹。

...
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" />
<property name="ivy.default.ivy.user.dir" value="${basedir}/ivy2" />
...

我正在使用 ivy 2.2 和 ant 1.8.2。你能检查一下它是否对你有用吗?

[编辑]:
来自 docs ,

Actually all ant properties are imported into ivy variables when the configuration is done (if you call ivy from ant). This means that if you define an ant property after the call to configure, it will not be available as an ivy variable.

关于ant - 在 Ant 中设置 Ivy 主目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4934948/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com