| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| <HTML> |
| <HEAD> |
| |
| <meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." > |
| |
| <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> |
| <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> |
| <LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css"> |
| <title>Using a different version of Ant</title> |
| <meta name="keyword" content="ant"> |
| <script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js"> </script> |
| </HEAD> |
| |
| <BODY BGCOLOR="#ffffff"> |
| <H1>Using a different version of Ant</H1> |
| |
| <P> The Eclipse platform provides Ant 1.7.0 as a plug-in library. When running |
| an Ant buildfile in the Workbench, version 1.7.0 is used by default. It is possible |
| to use different versions, although they are not supported. There are at least |
| two ways of using a different version of Ant: |
| </P> |
| |
| <dl> |
| <dt><b>Changing the Ant runtime classpath:</b></dt> |
| <dd>When Ant runs a buildfile, it looks for the necessary classes on the Ant classpath. |
| The Ant classpath consists of the plug-ins contributing new tasks, types or |
| libraries, plus the classpath defined in the Ant runtime classpath preferences. To |
| access the preferences, click |
| <a class="command-link" href='javascript:executeCommand("org.eclipse.ui.window.preferences(preferencePageId=org.eclipse.ant.ui.AntRuntimePreferencePage)")'> |
| <img src="PLUGINS_ROOT/org.eclipse.help/command_link.png"> |
| <b>Window > Preferences > Ant > Runtime</b></a>. |
| The JARs related to Ant 1.7.0 are grouped under the <b>Ant Home Entries</b> item. |
| To change the Ant Home entries, click on the <b>Ant Home...</b> button and choose the Ant |
| installation you wish to use. |
| |
| <p>After you change the Ant classpath, all future Ant builds will use the updated |
| version instead of the default. To restore the Ant classpath to its original |
| state, <b>Restore Defaults</b> button on the preference page. |
| </p> |
| </dd> |
| <dt><b>Using Ant as an external tool:</b></dt> |
| <dd>When changing the Ant classpath is not an option, or if you just want to test |
| a newer or beta version of Ant, using it as an external tool is an option. |
| Usually when it is running in the Workbench, the Ant buildfile |
| itself is considered to be a external tool, but this is not the only way. |
| To install a binary distribution of Ant as an external tool (<b>Note:</b> |
| These steps are for Windows, but similar methods can be used for other operating systems): |
| <ol type="a"> |
| <li>Download and install the binary version of Ant from |
| <a href="http://ant.apache.org" target="_blank">http://ant.apache.org</a> .</li> |
| <li>Click |
| <a class="command-link" href='javascript:executeCommand("org.eclipse.ui.externalTools.commands.OpenExternalToolsConfigurations")'> |
| <img src="PLUGINS_ROOT/org.eclipse.help/command_link.png"> |
| <b>Run > External Tools > External Tools...</b></a>.</li> |
| <li>Click <b>Program</b></li> |
| <li>Click <b>New</b>.</li> |
| <li>Enter a name for your external tool (for example, External Ant).</li> |
| <li>For the <b>Location</b> field, click <b>Browse File System</b>.</li> |
| <li>Find and select a file called <code>ant.bat</code> (it should be |
| in the <code>bin</code> folder of your Ant installation).</li> |
| <li>In the <b>Arguments</b> field enter the arguments for your |
| buildfile that would normally enter for running the buildfile outside of the |
| Workbench.</li> |
| <li>In the <b>Working Directory</b> field enter the directory of your buildfile.</li> |
| <li>Click <b>Run</b> to execute the buildfile.</li> |
| </ol> |
| |
| <p>When you run Ant as an external tool, none of the tasks or types |
| contributed by Eclipse will work. Also, the Ant classpath preference has no |
| effect in the buildfile execution. |
| </p> |
| </dd> |
| </dl> |
| |
| <p><img border="0" src="../images/ngrelc.png" alt="Related concepts" ><br> |
| <a href="../concepts/concepts-antsupport.htm">Ant Support</a><br> |
| <a href="../concepts/concepts-exttools.htm">External tools</a> |
| </p> |
| |
| <p><img border="0" src="../images/ngrelt.png" alt="Related tasks" ><br> |
| <a href="./tasks-ant-running.htm">Running Ant buildfiles</a><br> |
| <a href="../tasks/tasks-exttools-running.htm">Running external tools</a><br> |
| <a href="../tasks/tasks-ant-classpath.htm">Modifying the Ant classpath</a><br> |
| <a href="../tasks/tasks-ant-addtasksandtypes.htm">Adding new Ant tasks and types</a><br> |
| </p> |
| |
| </BODY> |
| </HTML> |