- Documentation (2.5.2)
- Release Notes
- Tutorials
- Reference
- Introduction
- System Properties
- 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
Ivy Files
Ivy use is entirely based on module descriptors known as "Ivy files". Ivy files are XML files, usually called ivy.xml, containing the description of the dependencies of a module, its published artifacts and its configurations.
Here is the simplest Ivy file you can write:
<ivy-module version="2.0">
<info organisation="myorg"
module="mymodule"/>
</ivy-module>
If you want to see a sample module descriptor using almost all possibilities of Ivy files, check this one, with or without XSLT.
Before beginning the reference itself, it is required to have in mind the terminology defined in the main page of this reference documentation.
For those familiar with XML schema, the schema used to validate Ivy files can be found here. For those using XSD aware IDE, you can declare the XSD in your Ivy files to benefit from code completion / validation:
<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation=
"http://ant.apache.org/ivy/schemas/ivy.xsd">
<info organisation="myorg"
module="mymodule"/>
</ivy-module>
Dynamic and resolved Ivy files
A module descriptor (Ivy file) is needed both before and after the publication of each revision of the module. Depending on the case, a module descriptor can be either dynamic or resolved.
Dynamic descriptor for module development
During the module development time, between publications, the descriptor helps in managing all the possibly changing dependencies of the module. For that purpose, development time Ivy files can declare dynamic dependencies to allow for a greater flexibility of use. Dynamic revision references like latest.integration
or 1.0.+
are possible and may resolve to different artifacts at different times. Variables can be used for even more flexibility. Development time Ivy files are hence called dynamic, because they can produce different results over time. The dynamic Ivy files are normally considered source files and kept with them (under SCM control).
Resolved descriptors for publishing
At each publication, another kind of a module descriptor is needed to document the dependencies of the particular published revision of the module. For that purpose, the descriptor usually needs to be fixed as its dependencies should no longer change. In doing so, the published module revision gets fixed, explicitly resolved dependencies. No variables are allowed either. Such publication-friendly, static Ivy files are called resolved, because they should always produce the same results. The resolved Ivy files are comparable to published artifacts and are kept with them in a repository.
Resolved Ivy files are generated from their original dynamic Ivy files via the deliver task.
Note that although it is technically possible to publish module revisions with dynamic Ivy files, it is not a generally recommended practice.
Hierarchical Index
ivy-module
Tag: ivy-module
The root tag of any Ivy file (module descriptor).
Attributes
Attribute | Description | Required |
---|---|---|
version |
the version of the Ivy file specification - should be '2.0' with current version of Ivy |
Yes |
Child elements
Element | Description | Cardinality |
---|---|---|
contains information about the described module |
1 |
|
container for configuration elements |
0..1 |
|
container for published artifact elements |
0..1 |
|
container for dependency elements |
0..1 |
|
section to configure the conflict managers to use |
0..1 |