- Documentation (2.3.0-rc1)
- Release Notes
- Settings Files
- Ivy Files
- Ant Tasks
- post resolve tasks
- Using standalone
- Developer doc
Tag: artifact Parent: dependency
This feature gives you more control on a dependency for which you do not control its ivy file.
It enables to specify the artifacts required, if the dependency has no ivy file.
Indeed, when a module has no ivy file, it is assumed that it publishes exactly one artifact having the same name as the module itself. But when this module publishes more artifacts, or simply does not respect the name rule, and if you cannot deliver an ivy file for it (because you do not control the repository, for instance - think about maven ibiblio repository, to give no name), then this feature let you specify the artifacts names you want to get.
Each artifact specification can be given in the context of particular master configurations. By default, if no configuration is specified, artifacts specification apply to all master configurations. But you can specify that a specification applies only to one or several master configurations, using either inline or nested conf specification. In this case, do not forget that if you do not specify any specification for a particular configuration, then no specification will apply for this configuration and it will be resolved not taking into account any specification.
For instance, imagine you have A, B & C master configurations. If you specify art1 in A & B and art2 in A, then C will not be specified at all, and will thus assume the default artifact. To prevent this, you have to specify a configuration mapping for the dependency, mapping only A & B to some or all dependency configurations.
<dependency org="yourorg" name="yourmodule9" rev="9.1" conf="A,B->default">since 1.4 It's possible to indicate the url at which the artifact can be found. This is not mandatory, and even not recommended with an enterprise repository. Note that Ivy will always look at the location where the artifact should be and only use the url if it cannot be found at the standard location in the repository.
<artifact name="art1" type="jar" conf="A,B"/>
<artifact name="art2" type="jar" conf="A"/>
since 1.4 This tag supports extra attributes.
since 2.0 This feature can also be used for modules having their own module descriptor, but which doesn't declare an artifact you know that is published. Note that in this case artifacts declared to be published by the dependency will be ignored, so do not forget to include all artifacts you want.
|name||the name of an artifact of the dependency module||Yes|
|type||the type of the artifact of the dependency module||Yes|
|ext||the extension of the artifact of the dependency module||No, defaults to type|
|conf||comma separated list of the master configurations in which this artifact should be included.
'*' wildcard can be used to designate all configurations of this module
|No, defaults to '*', unless nested conf are specified|
|url||an url where this artifact can be found if it isn't present at the standard location in the repository since 1.4||No, defaults to no url|
|conf||configuration in which the artifact should be included||0..n|
<dependency org="foo" name="bar" rev="1.0">Declares a dependency on module bar which only publish one artifact: baz.jar.
<artifact name="baz" type="jar"/>
<dependency org="foo" name="bar" rev="1.0">Same as above, except that if the artifact is not found at its standard location, Ivy will use http://www.acme.com/repository/bar/baz-1.0-acme.jar to download it.
<artifact name="baz" type="jar" url="http://www.acme.com/repository/bar/baz-1.0-acme.jar"/>
<dependency org="foo" name="bar" rev="1.0">Declares a dependency on module bar for which all artifacts declared will be used (thanks to the include tag) plus an artifact baz of type source and ext jar (which is not declared in module bar module descriptor).
<artifact name="baz" type="source" ext="jar"/>