The Importurl task will download a file, and import it's contents into the current project. The file can be in the form of a standard ant .xml project file, or a .jar/.zip file. In the case of a .jar/.zip file, the file is downloaded and then decompressed. After decompression, the file 'build.xml' at the root level of the jar is imported.
By importing a .jar/.zip file, one can package additional resources along with the build.xml file. However, you must be careful how you refer to these resources. The build.xml file must follow the same rules as any other file imported with the <import> task, in that references relative to the build.xml file must be made with the property: ant.file.<projectname> where <projectname> is the name of the project being imported, as specified in the project tag.
This task should be compatible with older versions of ant, but has only been tested with Ant 1.6.x
Attribute | Description | Required |
---|---|---|
url | The URL of the file to import. This can be any URL which is recognized by the <get> task. | Yes |
<antcontrib:importurl url="file:/path/to/build.xml" />
<antcontrib:importurl url="http://host/path/to/build.xml" />
<antcontrib:importurl url="http://host/path/to/common.jar" />
The following build.xml may be packaged into a .jar with it's corresponding
build.properties file:
<project name="common">
<property file="${ant.file.common}/build.properties" />
</project>
Copyright © 2002-2006 Ant-Contrib Project. All rights Reserved.