在蚂蚁设定常春藤主目录 [英] Setting ivy home directory in Ant

查看:138
本文介绍了在蚂蚁设定常春藤主目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想给ivy.default.ivy.user.dir设置为默认值以外的东西 $ {}的user.home /。ivy2 。我可以用

I would like to set the ivy.default.ivy.user.dir to something other than the default ${user.home}/.ivy2. I can do this on the command line with

蚂蚁-Divy.default.ivy.user.dir = $ {WORKSPACE} / IVYCACHE 。但是,我想有它设置没有命令行参数。我试图在我的build.xml,我common.xml和我ivysettings.xml设置此属性。但奇怪的是,它似乎默认缓存设置为这条道路,但详细的输出表示,没有默认设置user.dir来,所以它使用了 $ {}的user.home / .ivy2 路径。

ant -Divy.default.ivy.user.dir=${WORKSPACE}/IVYCACHE. But, I would like to have it set without a command line arg. I have tried setting this property in my build.xml, my common.xml and my ivysettings.xml. The strange thing is, that it seems to set the default cache to this path, but the verbose output says that there is no default setting for user.dir, so it uses the ${user.home}/.ivy2 path.

下面是输出当我设置在我的build.xml文件使用user.dir。
奇怪的是,它设置默认的缓存来我用user.dir来的路径

Here is the output when I set the user.dir in my build.xml file. Strangely, it sets the default cache to the path I used for 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

后来的后来,它声称user.dir来没有设置任何地方。
解析:

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

下面是我的build.xml行:

Here is my build.xml line:

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

我曾尝试加入这一行普通/ ivysettings.xml和普通/ common.xml没有运气。

I have tried adding this line to common/ivysettings.xml and common/common.xml with no luck.

推荐答案

环境变量ANT_OPTS允许设置JVM参数。所以,你可以把你的ANT_OPTS你调用与蚁族shell脚本相同的命令行参数。例如。根据M $ windoozer:

The environment variable ANT_OPTS allows to set jvm parameters. So you may put to your ANT_OPTS the same command line argument you invoke 'ant' shell script with. E.g. under m$ windoozer:

ANT_OPTS=-Divy.default.ivy.user.dir=C:/IVYCACHE

这篇关于在蚂蚁设定常春藤主目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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