1

I'm having difficulty getting Ivy to cooperate with my Jenkins project. The line of my ivysettings.xml file:

<caches defaultCacheDir="C:/Users/me/.ivy2/cache"/>

works for my local machine, but not when I try to have my Jenkins project access an SVN repository of mine where I have uploaded my local project. The error:

BUILD FAILED /data/builds/jenkins/workspace/build.xml:132: impossible to configure ivy:settings with given file: /data/builds/jenkins/workspace/ivysettings.xml : java.text.ParseException: failed to load settings from file:/data/builds/jenkins/workspace/ivysettings.xml: defaultCacheDir must be absolute: C:/Users/me/.ivy2/cache

I attempted to remedy the situation by instead using this answer to create an ivy cache dir at my jenkins workspace, placing

<properties environment="env" /> <caches defaultCacheDir="${env.WORKSPACE}/.ivy2/cache" />

into my ivysettings.xml file, but then the problem I was experiencing on Jenkins began happening on my local machine as well giving me the same message:

BUILD FAILED... ...defaultCacheDir must be absolute: ${env.WORKSPACE}/.ivy2/cache

Community
  • 1
  • 1
Dumpcats
  • 453
  • 5
  • 21

2 Answers2

1

Simplest way is to configure the location of the cache relative to the location of the ivysettings file as follows:

<ivysettings>
    <settings defaultResolver="central"/>
    <caches defaultCacheDir="${ivy.settings.dir}/cache"/>
    <resolvers>
        <ibiblio name="central" m2compatible="true"/>
    </resolvers>
</ivysettings>
Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185
0

The easiest way is to define env variable WORKSPACE on your PC

setenv WORKSPACE=c:/users/me

More clean way is to define env variable like IVY_CACHE_DIR both on your PC and in jenkins task and use it in your ivysettings.xml

Oleg Pavliv
  • 20,462
  • 7
  • 59
  • 75