How-To Guides
Getting Started
Policy Strategies
Format Strings
Extending Antlion
First Tutorial: Simple
Ant Tasks
inner processors
inner repositories
Optional Tasks
About optional tasks
Executes a project or artifact from another build file in the same way as the <subprojects> task, but without the creation of artificial targets. The artifacts and projects will be run in-place. Only one may be defined at a time per <run-subproject> task. If you need to build an artifact, you should consider using the <create-artifact> task instead.

Unlike the <subprojects> task, this can execute a separate build outside of a target.

Nested Elements


A reference to an <artifact>.

Attribute Description Required
refid The reference ID of the artifact Yes
buildif Allows for setting the conditions for invoking the artifact's builder, by checking the artifact. The possible values include:
  • always Always run the artifact's build.
  • not-exists If the artifact can't be found, then run the artifact's build.
  • out-of-date (default) If the artifact can't be found, or if its date-timestamp is less than any of its sources, then run the artifact's build. If the artifact provides no source list, then it only checks for the existence of the artifact.
No (defaults to "out-of-date")


Declares an external project build file, and all the targets that will be generated into local targets.

Attribute Description Required
antfile The ant build file to call. This is relative to the basedir parameter, or, if that's not set, then to the basedir of the current build file. If this parameter is not set, then it will default to "build.xml". No
basedir The directory to use as a "basedir" for the remote Ant build. If not set, it will use the antfile's owning directory. No
if Acts just like an "if" parameter on a target, and will be applied to each generated target. No
unless Acts just like an "unless" parameter on a target, and will be applied to each generated target. No
target The target to run in the external project. Yes

Nested Elements


Allows for passing a property to the underlying Ant task. See the corresponding task in Ant's documentation.


Allows for passing a PropertySet to the underlying Ant task. See the corresponding type in Ant's documentation.

<target name="compile">
    <artifact refid="xerces.jar" />
  <!-- run javac on the source with the dependent xerces jar -->
Executes the build description for the artifact with the id "xerces.jar". This will run the build for that artifact only if the source is out-of-date with the artifact.
<target name="zip">
    <project antfile="../another/mybuild.xml"
        targets="assemble" />

      create a zip including the dependent
      assembled files
Executes the build file "../another/mybuild.xml" using "../another" as its new basedir value, running the "assemble" target.

Document version $Revision: 1.8 $ $Date: 2005/11/30 18:56:38 $

SourceForge Logo
Copyright © 2004-2006, The Antlion Project