Question

After using this website for about 3 years, this is the first question I couldn't resolve by any of the already posted questions on here.

As the title says, I am looking for a way to change some of ivys default settings for console and overall use without changing any of the files inside the ivy or ant jars.

to be exact I want to change the default public repository to our company repository. Whilst I managed to do so for specific projects by adding the settings to the build.xml I could not find any (for me) understandable advise on how to change it per default as for example maven does with the settings.xml in .m2 folder.

TL;DR Can I have a settings file for ivy that is similar in behaviour to the settings file maven uses (.m2/settings)?

Was it helpful?

Solution

Personally, I have used one of the following approaches which I think are simpler and more practical, compared to the recommendations discussed in the ivy documentation.

Project settings file

If ivy detects an ivysettings.xml file in the root directory of my project it will automatically used (no special configuration required)

├── build.xml
├── ivysettings.xml   <-- Custom settings here
├── ivy.xml
└── src
    └── files

Host a central settings file

My standard resolve target references a common settings file located on a central server:

<target name="resolve" description="Use ivy to resolve classpaths">
    <ivy:settings url="http://mysite.com/ivysettings.xml" />
    <ivy:resolve/>

    <ivy:report todir='${ivy.reports.dir}' graph='false' xml='false'/>

    <ivy:cachepath pathid="compile.path" conf="compile"/>
    <ivy:cachepath pathid="test.path"    conf="test"/>
</target>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top