- Documentation (2.5.0-rc2-local-20180419193918)
- Release Notes
- Settings Files
- Ivy Files
- Ant Tasks
- post resolve tasks
- Using standalone
- Developer doc
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>
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>
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
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.
The root tag of any Ivy file (module descriptor).
the version of the Ivy file specification - should be '2.0' with current version of Ivy
contains information about the described module
container for configuration elements
container for published artifact elements
container for dependency elements
section to configure the conflict managers to use