[ 
https://issues.apache.org/jira/browse/IVY-907?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12632394#action_12632394
 ] 

Xavier Hanin commented on IVY-907:
----------------------------------

Ok, I think I've found the problem: the default cache location is initialized 
by default using the value of the ivy.cache.dir variable. The problem is that 
during this initialization, variable substitution is not done. In your case you 
set this variable to ${env.IVY_CACHE_DIR}, which is not expanded by Ivy and 
thus lead to a non absolute path. 

With the old version it works because you actually never use the default cache 
location, since you explicitly set the repository cache dir and the resolution 
cache dir. But if you run with the old version in verbose mode, you will see in 
the dumped settings that ${env.IVY_CACHE_DIR} is not expanded either.

So the fix is too expand variables values when using the ivy.cache.dir variable 
to set the default cache dir value.

The workaround is to use another variable as basis for your cache, since you 
don't actually want to set the default cache with that. Or you can also 
explicitly set the defaultCacheDir="${ivy.cache.dir}" in your caches settings, 
since this one will expand the variables values.

To conclude, since there is a workaround, and the bug case is not too frequent 
(you need to set ivy.cache.dir to a value with a variable) I don't think this 
is a blocking issue for 2.0-rc1 or 2.0-final either.

> Environment properties in ivy settings are no longer resolved
> -------------------------------------------------------------
>
>                 Key: IVY-907
>                 URL: https://issues.apache.org/jira/browse/IVY-907
>             Project: Ivy
>          Issue Type: Bug
>    Affects Versions: 2.0-RC1
>            Reporter: Erik-Berndt Scheper
>            Assignee: Maarten Coene
>             Fix For: 2.0.x
>
>         Attachments: IVY-907.zip, ivysettings.zip
>
>
> I have an ivy.settings.xml file published on an intranet http server, which 
> includes a property file from the same http server. (see attached files). 
> This property file includes the property:
> {code}ivy.cache.dir                     = ${env.IVY_CACHE_DIR}{code}
> This environment based property is no longer resolved when I use the proposed 
> ivy-2.0.0-rc1.jar. This leads to the following error during resolve:
> {noformat}
> ivy.check:
> ivy.init:
>     [mkdir] Created dir: 
> D:\ws\eclipse-3.4\AAD\AAD-domain-model\target\reports\ivy
> ivy.resolve:
> [ivy:resolve] :: Ivy 2.0.0-rc1 - 20080916082609 :: http://ant.apache.org/ivy/ 
> ::
> :: loading settings :: url = 
> http://172.30.247.68/ivy-settings/ivy.settings.xml
> BUILD FAILED
> D:\ws\eclipse-3.4\AAD\build\build-ivy\build.ivy.xml:75: 
> java.lang.IllegalArgumentException: ivy.cache.dir must be absolute: 
> ${env.IVY_CACHE_DIR}
> Total time: 2 seconds
> {noformat}
> The same ivy settings files worked perfectly well with a previous ivy which I 
> built from trunk: org.apache.ivy_2.0.0.rc1_20080813101604.jar

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to