- Documentation (2.6.0-local-20230820130639)
- 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
fixdeps
[since 2.4]
The fixdeps
task serializes transitively resolved dependencies into an ivy.xml
file.
The dependencies declared in an ivy.xml
can be specified as range of revisions. And the transitive dependencies too. As new versions of modules can be added to the repository anytime, resolved versions of ranges can change over time. It is then safer to resolve a range once and stick with the resolved revision. This way a resolve process is highly reproducible.
It is especially useful in a very dynamic environment like the OSGi one.
In a multi project environment some dependencies still need to be maintained loose: the ones between the projects. These dependencies, as soon as they are declared in the original ivy.xml, can be kept from being fixed. In order to do so, use the inner element keep
.
The recommended setup is then to:
-
have an
ivy-spec.xml
in your project which specifies the dependencies, with ranges if needed -
have an Ant target which resolves the
ivy-spec.xml
and callfixdeps
to generate anivy.xml
. This target should then only be called afterivy-spec.xml
is modified. The generatedivy.xml
can safely be shared in a version control repository (Git, Subversion, …). -
make the entire build workflow based on the resolve of the generated
ivy.xml
This is a post resolve task, with all the behaviour and attributes common to all post resolve tasks.
Attributes
Attribute | Description | Required |
---|---|---|
tofile |
The location of the Ivy file to generate |
Yes |
Child elements
Element | Description | Cardinality |
---|---|---|
keep |
declares a dependency to keep from being fixed, and keep its original declaration from the original ivy.xml These elements takes two attributes: |
0..n |
Examples
<ivy:fixdeps tofile="ivy-fixed.xml"/>
Simple fix of some dependencies.
<ivy:fixdeps tofile="ivy-fixed.xml">
<keep org="com.acme" module="mymodule"/>
</ivy:fixdeps>
Fix of the dependencies but keep the dependency on com.acme#mymodule
as defined in the original ivy.xml.