configure
The configure task is used to configure ivy with an xml configuration file.
See configuration for details about the configuration file itself.
Note for developers:
After the call to this task, a reference to the configured ivy instance used by all subsequent ant tasks is put in the ant project, under the id "ivy.instance".
Since 1.4: It's also possible to configure authentication settings for multiple urls. This can be done with the <credentials> subelements. See the examples for more details.
See configuration for details about the configuration file itself.
Note for developers:
After the call to this task, a reference to the configured ivy instance used by all subsequent ant tasks is put in the ant project, under the id "ivy.instance".
Attribute | Description | Required |
---|---|---|
file | path to the configuration file to use | No. If a file is provided, url is ignored. If none are provided, then it attempts to find a file at ${ivy.conf.file}, and if this file does not exist, it uses a default configuration file |
url | url of the configuration file to use | |
host | http authentication host | No, unless authentication is required |
realm | http authentication realm | |
username | http authentication user name | |
passwd | http authentication password |
HTTP Authentication
Note: HTTP Authentication can be used only if commons-httpclient.jar is in your classpath If any of the url you use in ivy (especially in dependency resolvers) need http authentication, then you have to provide the host, realm, username and passwd attributes of the configure task. These settings will then be used in any further call to ivy tasks.Since 1.4: It's also possible to configure authentication settings for multiple urls. This can be done with the <credentials> subelements. See the examples for more details.
Examples
Simplest configuration
<ivy:configure />Use either ${ivy.conf.file} if it exists, or the default configuration file
Configure with a file
<ivy:configure file="myconffile.xml" />
Configure with an url
<ivy:configure url="http://mysite.com/myconffile.xml" />
Configure multiple URLs which require autentication
<ivy:configure file="path/to/my/ivyconf.xml"> <credentials host="myhost.com" realm="My Realm" username="myuser" passwd="mypasswd" /> <credentials host="yourhost.com" realm="Your Realm" username="myuser" passwd="myotherpasswd" /> </ivy:configure>