- Documentation (2.5.0-rc1)
- Release Notes
- Tutorials
- Reference
- Introduction
- Settings Files
- Ivy Files
- Ant Tasks
- artifactproperty
- artifactreport
- buildlist
- buildnumber
- buildobr
- cachefileset
- cachepath
- checkdepsupdate
- cleancache
- configure
- convertmanifest
- convertpom
- deliver
- dependencytree
- findrevision
- fixdeps
- info
- install
- listmodules
- makepom
- post resolve tasks
- publish
- report
- repreport
- resolve
- resources
- retrieve
- settings
- var
- Using standalone
- OSGi
- Developer doc
Settings Files
In order to work as you want, Ivy sometimes needs some settings. Actually, Ivy can work with no specific settings at all, see the default settings documentation for details about that. But Ivy is able to work in very different contexts. You just have to configure it properly.
Settings are specified through an XML file, usually called ivysettings.xml
. To configure Ivy from Ant, you just have to use the settings datatype with the path of your settings file.
Here is an example of the settings file:
<ivysettings>
<properties file="${ivy.settings.dir}/ivysettings-file.properties"/>
<settings defaultResolver="ibiblio"/>
<caches defaultCacheDir="${cache.dir}" checkUpToDate="false"/>
<resolvers>
<ibiblio name="ibiblio"/>
<filesystem name="internal">
<ivy pattern="${repository.dir}/[module]/ivy-[revision].xml"/>
<artifact pattern="${repository.dir}/[module]/[artifact]-[revision].[ext]"/>
</filesystem>
</resolvers>
<modules>
<module organisation="jayasoft" name=".*" resolver="internal"/>
</modules>
</ivysettings>
Note: To work, this settings file needs a property file named ivysettings-file.properties in the same directory as the settings file, with Ivy variables you want in it.
Mainly, the settings enable you to configure the default cache directory used by Ivy and the dependency resolvers that it will use to resolve dependencies.
Some useful variables are available for use in settings files:
-
ivy.settings.dir
this variable references the directory in which the settings file itself is. This is available if the settings has been loaded as a file. In case of a URL, it takes the part before the last slash of the URL, if any. If the URL has no slash, then this variable is not set. -
ivy.settings.file
the path of the settings file itself if it has been loaded as a file only. If it has been loaded as a URL, this variable is not set. -
ivy.settings.url
the URL pointing to the settings file. This is set both when it has been loaded as a file or a URL.
(since 1.4) Note that all Java system properties are available as Ivy variables in your settings file.
Settings file structure
The settings file is structured in some parts and left open in others. In fact, each resolver has its own structure, thus it’s not the settings file itself which defines the structure for the resolvers.
ivysettings
ivysettings
Tag: ivysettings
Root tag of any Ivy settings file.
Child elements
Element | Description | Cardinality |
---|---|---|
set an Ivy variable |
0..n |
|
loads a properties file as Ivy variables |
0..n |
|
configures Ivy with some defaults |
0..1 |
|
includes another settings file |
0..n |
|
add a location in the classpath used to load plugins |
0..n |
|
defines new types in Ivy |
0..n |
|
defines lock strategies |
0..1 |
|
defines repository cache managers |
0..1 |
|
defines latest strategies |
0..1 |
|
defines module descriptor parsers |
0..1 |
|
defines new namespaces |
0..1 |
|
defines a new macro resolver |
0..n |
|
defines dependency resolvers |
0..1 |
|
defines conflict managers |
0..1 |
|
defines rules between modules and dependency resolvers |
0..1 |
|
defines the list of available report outputters |
0..1 |
|
defines the list of available statuses |
0..1 |
|
register triggers on Ivy events |
0..1 |
|
defines new version matchers |
0..1 |
|
defines the list of available timeout-constraints |
0..n |