- Home
- Download
- Documentation (2.3.0-rc1)
- Release Notes
- Tutorials
- Reference
- Introduction
- Settings Files
- Ivy Files
- Ant Tasks
- Using standalone
- OSGi
- Developer doc
- History
- Get Involved
- Foundation
- Search
- Apache IvyDE
artifactproperty
since 1.1
Sets an ant property for each dependency artifacts previously resolved.since 2.0 This is a post resolve task, with all the behaviour and attributes common to all post resolve tasks.
Please prefer the use of retrieve + standard ant path creation, which make your build more independent from ivy (once artifacts are properly retrieved, ivy is not required any more).
The property name and value are generated using the classical pattern concept, all artifact tokens and ivy variables being available.
since 2.0 This tag will follow the ant usual behavior for properties. If a property of the same name already exist, it's value will be unchanged. This behavior can be changed using the 'overwrite' attribute.
WARNING : Before 2.0, the behavior was to overwrite the properties. Since 2.0, the default is to not overwrite to properties
Attributes
Attribute | Description | Required |
---|---|---|
name | a pattern used to generate the name of the properties to set | Yes |
value | a pattern used to generate the value of the properties to set | Yes |
conf | a comma separated list of the configurations for which properties should be set | No. Defaults to the configurations resolved by the last resolve call, or * if no resolve was explicitly called |
haltonfailure | true to halt the build on ivy failure, false to continue | No. Defaults to true |
validate | true to force ivy files validation against ivy.xsd, false to force no validation | No. Defaults to default ivy value (as configured in configuration file) |
settingsRef | A reference to the ivy settings that must be used by this task (since 2.0) | No, 'ivy.instance' is taken by default. |
overwrite | Overwrite the value of the property if it already exist (since 2.0). Before 2.0, the properties were always overwritten. | No, 'false' by default. |
Example
Suppose we have one dependency called mydep in revision 1.0 publishing two artifacts: foo.jar and bar.jar.Then:
<artifactproperty conf="build"will set two properties:
name="[module].[artifact]-[revision]"
value="${cache.dir}/[module]/[artifact]-[revision].[ext]"/>
mydep.foo-1.0 = my/cache/dir/mydep/foo-1.0.jar
mydep.bar-1.0 = my/cache/dir/mydep/bar-1.0.jar