Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 616 lines (561 sloc) 25.298 kb
3e697dfb »
2006-09-11 Add license header
1 <!--
2 Licensed to the Apache Software Foundation (ASF) under one or more
3 contributor license agreements. See the NOTICE file distributed with
4 this work for additional information regarding copyright ownership.
5 The ASF licenses this file to You under the Apache License, Version 2.0
6 (the "License"); you may not use this file except in compliance with
7 the License. You may obtain a copy of the License at
8
9 http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16 -->
6e4afb17 »
2001-04-10 Move the "Running Ant" section from "Installing Ant" to a page of its…
17 <html>
18
19 <head>
20 <meta http-equiv="Content-Language" content="en-us">
7fd4bc77 »
2005-04-29 Removing some gratuitous XHTML-isms. They still break JavaHelp, alas,…
21 <link rel="stylesheet" type="text/css" href="stylesheets/style.css">
ea8bc1d8 »
2002-02-04 Fix title Strings
22 <title>Running Apache Ant</title>
6e4afb17 »
2001-04-10 Move the "Running Ant" section from "Installing Ant" to a page of its…
23 </head>
24
25 <body>
26
9907b7b8 »
2010-11-11 make sure each page of the Ant website says 'Apache Ant' at least onc…
27 <h1>Running Apache Ant</h1>
d7b8f747 »
2001-12-13 Add TOCs for Installing, Using, Running, Developing; add some name tags;
28 <h2><a name="commandline">Command Line</a></h2>
9907b7b8 »
2010-11-11 make sure each page of the Ant website says 'Apache Ant' at least onc…
29 <p> If you've installed Apache Ant as described in the
d7b8f747 »
2001-12-13 Add TOCs for Installing, Using, Running, Developing; add some name tags;
30 <a href="install.html"> Installing Ant</a> section,
31 running Ant from the command-line is simple: just type
32 <code>ant</code>.</p>
33 <p>When no arguments are specified, Ant looks for a <code>build.xml</code>
34 file in the current directory and, if found, uses that file as the
c164b6ae »
2002-06-22 Merge changes made to 1.5 Beta2.
35 build file and runs the target specified in the <code>default</code>
36 attribute of the <code>&lt;project&gt;</code> tag.
37 To make Ant use
38 a build file other than <code>build.xml</code>, use the command-line
39 option <nobr><code>-buildfile <i>file</i></code></nobr>,
a16cfac0 »
2011-11-21 -f/-file/-buildfile accepts a directory containing build.xml.
40 where <i>file</i> is the name of the build file you want to use
41 (or a directory containing a <code>build.xml</code> file).</p>
c164b6ae »
2002-06-22 Merge changes made to 1.5 Beta2.
42 If you use the <nobr><code>-find [<i>file</i>]</code></nobr> option,
43 Ant will search for a build file first in the current directory, then in
44 the parent directory, and so on, until either a build file is found or the root
45 of the filesystem has been reached. By default, it will look for a build file
46 called <code>build.xml</code>. To have it search for a build file other
47 than <code>build.xml</code>, specify a file argument.
48 <strong>Note:</strong> If you include any other flags or arguments
49 on the command line after
50 the <nobr><code>-find</code></nobr> flag, you must include the file argument
51 for the <nobr><code>-find</code></nobr> flag, even if the name of the
52 build file you want to find is <code>build.xml</code>.
53
54 <p>You can also set <a href="using.html#properties">properties</a> on the
55 command line. This can be done with
6e4afb17 »
2001-04-10 Move the "Running Ant" section from "Installing Ant" to a page of its…
56 the <nobr><code>-D<i>property</i>=<i>value</i></code></nobr> option,
57 where <i>property</i> is the name of the property,
c164b6ae »
2002-06-22 Merge changes made to 1.5 Beta2.
58 and <i>value</i> is the value for that property. If you specify a
59 property that is also set in the build file
114eca2b »
2010-05-26 Obliterating "core" vs. "optional" distinction for tasks and types in…
60 (see the <a href="Tasks/property.html">property</a> task),
c164b6ae »
2002-06-22 Merge changes made to 1.5 Beta2.
61 the value specified on the
62 command line will override the value specified in the
63 build file.
64 Defining properties on the command line can also be used to pass in
1b887b5a »
2005-05-02 Convert some " - " to emdashes, semicolons, etc. where appropriate.
65 the value of environment variables; just pass
c164b6ae »
2002-06-22 Merge changes made to 1.5 Beta2.
66 <nobr><code>-DMYVAR=%MYVAR%</code></nobr> (Windows) or
6e4afb17 »
2001-04-10 Move the "Running Ant" section from "Installing Ant" to a page of its…
67 <nobr><code>-DMYVAR=$MYVAR</code></nobr> (Unix)
c164b6ae »
2002-06-22 Merge changes made to 1.5 Beta2.
68 to Ant. You can then access
69 these variables inside your build file as <code>${MYVAR}</code>.
70 You can also access environment variables using the
114eca2b »
2010-05-26 Obliterating "core" vs. "optional" distinction for tasks and types in…
71 <a href="Tasks/property.html"> property</a> task's
c164b6ae »
2002-06-22 Merge changes made to 1.5 Beta2.
72 <code>environment</code> attribute.
d7b8f747 »
2001-12-13 Add TOCs for Installing, Using, Running, Developing; add some name tags;
73 </p>
6e4afb17 »
2001-04-10 Move the "Running Ant" section from "Installing Ant" to a page of its…
74
c164b6ae »
2002-06-22 Merge changes made to 1.5 Beta2.
75 <p>Options that affect the amount of logging output by Ant are:
76 <nobr><code>-quiet</code></nobr>,
6e4afb17 »
2001-04-10 Move the "Running Ant" section from "Installing Ant" to a page of its…
77 which instructs Ant to print less
c164b6ae »
2002-06-22 Merge changes made to 1.5 Beta2.
78 information to the console;
6e4afb17 »
2001-04-10 Move the "Running Ant" section from "Installing Ant" to a page of its…
79 <nobr><code>-verbose</code></nobr>, which causes Ant to print
dab87600 »
2012-08-15 Add a log mode which logs nothing but ant task output and build failu…
80 additional information to the console; <nobr><code>-debug</code></nobr>,
81 which causes Ant to print considerably more additional information; and
82 <nobr><code>-silent</code></nobr> which makes Ant print nothing but task
83 output and build failures (useful to capture Ant output by scripts).
d7b8f747 »
2001-12-13 Add TOCs for Installing, Using, Running, Developing; add some name tags;
84 </p>
6e4afb17 »
2001-04-10 Move the "Running Ant" section from "Installing Ant" to a page of its…
85
86 <p>It is also possible to specify one or more targets that should be executed.
87 When omitted, the target that is specified in the
d7b8f747 »
2001-12-13 Add TOCs for Installing, Using, Running, Developing; add some name tags;
88 <code>default</code> attribute of the
89 <a href="using.html#projects"><code>project</code></a> tag is
6e4afb17 »
2001-04-10 Move the "Running Ant" section from "Installing Ant" to a page of its…
90 used.</p>
91
d7b8f747 »
2001-12-13 Add TOCs for Installing, Using, Running, Developing; add some name tags;
92 <p>The <nobr><code>-projecthelp</code></nobr> option prints out a list
c164b6ae »
2002-06-22 Merge changes made to 1.5 Beta2.
93 of the build file's targets. Targets that include a
94 <code>description</code> attribute are listed as &quot;Main targets&quot;,
95 those without a <code>description</code> are listed as
15fe6f17 »
2006-04-13 Clarify doc re other (sub) targets in -p mode. PR# 39302
96 &quot;Other targets&quot;, then the &quot;Default&quot; target is listed
97 ("Other targets" are only displayed if there are no main
98 targets, or if Ant is invoked in -verbose or -debug mode).
6e4afb17 »
2001-04-10 Move the "Running Ant" section from "Installing Ant" to a page of its…
99
d7b8f747 »
2001-12-13 Add TOCs for Installing, Using, Running, Developing; add some name tags;
100 <h3><a name="options">Command-line Options Summary</a></h3>
6e4afb17 »
2001-04-10 Move the "Running Ant" section from "Installing Ant" to a page of its…
101 <pre>ant [options] [target [target2 [target3] ...]]
102 Options:
ade742b4 »
2003-10-03 This is the first visible divergence ofAnt1.7 from 1.6...ant 1.7 has …
103 -help, -h print this message
104 -projecthelp, -p print project help information
a4e11d18 »
2002-02-01 Add -propertyfile command-line option.
105 -version print the version information and exit
e044d6d9 »
2002-09-02 Show all command line options of Ant and fix a typo.
106 -diagnostics print information that might be helpful to
107 diagnose or report problems.
108 -quiet, -q be extra quiet
dab87600 »
2012-08-15 Add a log mode which logs nothing but ant task output and build failu…
109 -silent, -S print nothing but task outputs and build failures
e044d6d9 »
2002-09-02 Show all command line options of Ant and fix a typo.
110 -verbose, -v be extra verbose
ade742b4 »
2003-10-03 This is the first visible divergence ofAnt1.7 from 1.6...ant 1.7 has …
111 -debug, -d print debugging information
112 -emacs, -e produce logging information without adornments
113 -lib &lt;path&gt; specifies a path to search for jars and classes
e044d6d9 »
2002-09-02 Show all command line options of Ant and fix a typo.
114 -logfile &lt;file&gt; use given file for log
115 -l &lt;file&gt; ''
116 -logger &lt;classname&gt; the class which is to perform logging
117 -listener &lt;classname&gt; add an instance of class as a project listener
ade742b4 »
2003-10-03 This is the first visible divergence ofAnt1.7 from 1.6...ant 1.7 has …
118 -noinput do not allow interactive input
e044d6d9 »
2002-09-02 Show all command line options of Ant and fix a typo.
119 -buildfile &lt;file&gt; use given buildfile
120 -file &lt;file&gt; ''
121 -f &lt;file&gt; ''
3a3a83bd »
2002-09-03 Replace > with &gt; where appropriate.
122 -D&lt;property&gt;=&lt;value&gt; use value for given property
2a14ce63 »
2003-07-16 Add make's keep-going feature into ANT.
123 -keep-going, -k execute all targets that do not depend
124 on failed target(s)
e044d6d9 »
2002-09-02 Show all command line options of Ant and fix a typo.
125 -propertyfile &lt;name&gt; load all properties from file with -D
126 properties taking precedence
127 -inputhandler &lt;class&gt; the class which will handle input requests
ade742b4 »
2003-10-03 This is the first visible divergence ofAnt1.7 from 1.6...ant 1.7 has …
128 -find &lt;file&gt; (s)earch for buildfile towards the root of
129 -s &lt;file&gt; the filesystem and use it
130 -nice number A niceness value for the main thread:
036b72ad »
2003-11-28 Document org.apache.tools.ant.ProjectHelper System property.
131 1 (lowest) to 10 (highest); 5 is the default
9531796e »
2005-01-13 doc updates; especially command line options, why we hate CLASSPATH a…
132 -nouserlib Run ant without using the jar files from ${user.home}/.ant/lib
15fe6f17 »
2006-04-13 Clarify doc re other (sub) targets in -p mode. PR# 39302
133 -noclasspath Run ant without using CLASSPATH
ed36e3ac »
2006-12-11 automatic proxy handling is only there if -autoproxy is set; marked a…
134 -autoproxy Java 1.5+ : use the OS proxies
106d0347 »
2006-10-16 Codestyle (indent of bracket) and overwrite the taskname for logging.
135 -main &lt;class&gt; override Ant's normal entry point
6e4afb17 »
2001-04-10 Move the "Running Ant" section from "Installing Ant" to a page of its…
136 </pre>
aeda3515 »
2001-12-14 Add documentation on Loggers and Listeners.
137 <p>For more information about <code>-logger</code> and
c164b6ae »
2002-06-22 Merge changes made to 1.5 Beta2.
138 <code>-listener</code> see
139 <a href="listeners.html">Loggers &amp; Listeners</a>.
140 <p>For more information about <code>-inputhandler</code> see
141 <a href="inputhandler.html">InputHandler</a>.
203ebc61 »
2006-10-16 Document two launch options.
142 <p>Easiest way of changing the exit-behaviour is subclassing the original main class:
143 <pre>
144 public class CustomExitCode extends org.apache.tools.ant.Main {
145 protected void exit(int exitCode) {
146 // implement your own behaviour, e.g. NOT exiting the JVM
147 }
148 }
149 </pre> and starting Ant with access (<tt>-lib path-to-class</tt>) to this class.
150 </p>
c164b6ae »
2002-06-22 Merge changes made to 1.5 Beta2.
151
00210f39 »
2003-10-02 merge
152 <h3><a name="libs">Library Directories</a></h3>
153 <p>
154 Prior to Ant 1.6, all jars in the ANT_HOME/lib would be added to the CLASSPATH
155 used to run Ant. This was done in the scripts that started Ant. From Ant 1.6,
156 two directories are scanned by default and more can be added as required. The
157 default directories scanned are ANT_HOME/lib and a user specific directory,
158 ${user.home}/.ant/lib. This arrangement allows the Ant installation to be
159 shared by many users while still allowing each user to deploy additional jars.
160 Such additional jars could be support jars for Ant's optional tasks or jars
8915a629 »
2012-05-26 Bug 53291 - Several spell checker findings in apache ant 1.8.3 docume…
161 containing third-party tasks to be used in the build. It also allows the main Ant installation to be locked down which will please system administrators.
00210f39 »
2003-10-02 merge
162 </p>
163
164 <p>
165 Additional directories to be searched may be added by using the -lib option.
166 The -lib option specifies a search path. Any jars or classes in the directories
167 of the path will be added to Ant's classloader. The order in which jars are
5fb848c2 »
2005-05-09 Spelling/punctuation/wording/etc.
168 added to the classpath is as follows:
00210f39 »
2003-10-02 merge
169 </p>
170
171 <ul>
172 <li>-lib jars in the order specified by the -lib elements on the command line</li>
9531796e »
2005-01-13 doc updates; especially command line options, why we hate CLASSPATH a…
173 <li>jars from ${user.home}/.ant/lib (unless -nouserlib is set)</li>
00210f39 »
2003-10-02 merge
174 <li>jars from ANT_HOME/lib</li>
175 </ul>
176
177 <p>
178 Note that the CLASSPATH environment variable is passed to Ant using a -lib
203ebc61 »
2006-10-16 Document two launch options.
179 option. Ant itself is started with a very minimalistic classpath.
9531796e »
2005-01-13 doc updates; especially command line options, why we hate CLASSPATH a…
180 Ant should work perfectly well with an empty CLASSPATH environment variable,
5fb848c2 »
2005-05-09 Spelling/punctuation/wording/etc.
181 something the the -noclasspath option actually enforces. We get many more support calls related to classpath problems (especially quoting problems) than
9531796e »
2005-01-13 doc updates; especially command line options, why we hate CLASSPATH a…
182 we like.
183
00210f39 »
2003-10-02 merge
184 </p>
185
186 <p>
187 The location of ${user.home}/.ant/lib is somewhat dependent on the JVM. On Unix
188 systems ${user.home} maps to the user's home directory whilst on recent
189 versions of Windows it will be somewhere such as
190 C:\Documents&nbsp;and&nbsp;Settings\username\.ant\lib. You should consult your
191 JVM documentation for more details.
192 </p>
193
6e4afb17 »
2001-04-10 Move the "Running Ant" section from "Installing Ant" to a page of its…
194 <h3>Examples</h3>
195 <blockquote>
196 <pre>ant</pre>
197 </blockquote>
198 <p>runs Ant using the <code>build.xml</code> file in the current directory, on
199 the default target.</p>
679116e2 »
2009-04-21 Example: How to pass multiple JARs via -lib
200
6e4afb17 »
2001-04-10 Move the "Running Ant" section from "Installing Ant" to a page of its…
201 <blockquote>
202 <pre>ant -buildfile test.xml</pre>
203 </blockquote>
204 <p>runs Ant using the <code>test.xml</code> file in the current directory, on
205 the default target.</p>
679116e2 »
2009-04-21 Example: How to pass multiple JARs via -lib
206
6e4afb17 »
2001-04-10 Move the "Running Ant" section from "Installing Ant" to a page of its…
207 <blockquote>
208 <pre>ant -buildfile test.xml dist</pre>
209 </blockquote>
c164b6ae »
2002-06-22 Merge changes made to 1.5 Beta2.
210 <p>runs Ant using the <code>test.xml</code> file in the current directory, on
211 the target called <code>dist</code>.</p>
679116e2 »
2009-04-21 Example: How to pass multiple JARs via -lib
212
6e4afb17 »
2001-04-10 Move the "Running Ant" section from "Installing Ant" to a page of its…
213 <blockquote>
214 <pre>ant -buildfile test.xml -Dbuild=build/classes dist</pre>
215 </blockquote>
c164b6ae »
2002-06-22 Merge changes made to 1.5 Beta2.
216 <p>runs Ant using the <code>test.xml</code> file in the current directory, on
217 the target called <code>dist</code>, setting the <code>build</code> property
218 to the value <code>build/classes</code>.</p>
6e4afb17 »
2001-04-10 Move the "Running Ant" section from "Installing Ant" to a page of its…
219
00210f39 »
2003-10-02 merge
220 <blockquote>
221 <pre>ant -lib /home/ant/extras</pre>
222 </blockquote>
223 <p>runs Ant picking up additional task and support jars from the
679116e2 »
2009-04-21 Example: How to pass multiple JARs via -lib
224 /home/ant/extras location</p>
225
226 <blockquote>
227 <pre>ant -lib one.jar;another.jar</pre>
228 <pre>ant -lib one.jar -lib another.jar</pre>
229 </blockquote>
230 <p>adds two jars to Ants classpath.</p>
231
232
00210f39 »
2003-10-02 merge
233
d7b8f747 »
2001-12-13 Add TOCs for Installing, Using, Running, Developing; add some name tags;
234 <h3><a name="files">Files</a></h3>
3fd37dfd »
2001-06-13 Various typos and documentation fixes.
235
236 <p>The Ant wrapper script for Unix will source (read and evaluate) the
c164b6ae »
2002-06-22 Merge changes made to 1.5 Beta2.
237 file <code>~/.antrc</code> before it does anything. On Windows, the Ant
238 wrapper batch-file invokes <code>%HOME%\antrc_pre.bat</code> at the start and
3fd37dfd »
2001-06-13 Various typos and documentation fixes.
239 <code>%HOME%\antrc_post.bat</code> at the end. You can use these
c164b6ae »
2002-06-22 Merge changes made to 1.5 Beta2.
240 files, for example, to set/unset environment variables that should only be
241 visible during the execution of Ant. See the next section for examples.</p>
3fd37dfd »
2001-06-13 Various typos and documentation fixes.
242
d7b8f747 »
2001-12-13 Add TOCs for Installing, Using, Running, Developing; add some name tags;
243 <h3><a name="envvars">Environment Variables</a></h3>
3fd37dfd »
2001-06-13 Various typos and documentation fixes.
244
245 <p>The wrapper scripts use the following environment variables (if
246 set):</p>
247
248 <ul>
f586574c »
2001-10-17 Allow for an ANT_ARGS environment variable, for setting things like
249 <li><code>JAVACMD</code> - full path of the Java executable. Use this
3fd37dfd »
2001-06-13 Various typos and documentation fixes.
250 to invoke a different JVM than <code>JAVA_HOME/bin/java(.exe)</code>.</li>
251
f586574c »
2001-10-17 Allow for an ANT_ARGS environment variable, for setting things like
252 <li><code>ANT_OPTS</code> - command-line arguments that should be
32d340ba »
2002-04-25 properties -> system properties (as suggested by Knut Wannheden).
253 passed to the JVM. For example, you can define system properties or set
3fd37dfd »
2001-06-13 Various typos and documentation fixes.
254 the maximum Java heap size here.</li>
f586574c »
2001-10-17 Allow for an ANT_ARGS environment variable, for setting things like
255
256 <li><code>ANT_ARGS</code> - Ant command-line arguments. For example,
c164b6ae »
2002-06-22 Merge changes made to 1.5 Beta2.
257 set <code>ANT_ARGS</code> to point to a different logger, include a
258 listener, and to include the <code>-find</code> flag.</li>
259 <strong>Note:</strong> If you include <code>-find</code>
260 in <code>ANT_ARGS</code>, you should include the name of the build file
261 to find, even if the file is called <code>build.xml</code>.
3fd37dfd »
2001-06-13 Various typos and documentation fixes.
262 </ul>
263
036b72ad »
2003-11-28 Document org.apache.tools.ant.ProjectHelper System property.
264 <h3><a name="sysprops">Java System Properties</a></h3>
5fb848c2 »
2005-05-09 Spelling/punctuation/wording/etc.
265 <p>Some of Ant's core classes can be configured via system properties.</p>
9531796e »
2005-01-13 doc updates; especially command line options, why we hate CLASSPATH a…
266 <p>Here is the result of a search through the codebase. Because system properties are
1d8cbd40 »
2003-12-03 Add more system properties
267 available via Project instance, I searched for them with a
268 <pre>
36f8a0dc »
2004-11-16 > -> &gt;
269 grep -r -n "getPropert" * &gt; ..\grep.txt
1d8cbd40 »
2003-12-03 Add more system properties
270 </pre>
271 command. After that I filtered out the often-used but not-so-important values (most of them
203ebc61 »
2006-10-16 Document two launch options.
272 read-only values): <i>path.separator, ant.home, basedir, user.dir, os.name,
1d8cbd40 »
2003-12-03 Add more system properties
273 line.separator, java.home, java.version, java.version, user.home, java.class.path</i><br>
274 And I filtered out the <i>getPropertyHelper</i> access.</p>
275 <table border="1">
276 <tr>
277 <th>property name</th>
278 <th>valid values /default value</th>
279 <th>description</th>
280 </tr>
281 <tr>
455fa9ce »
2006-04-11 document ant.build.source/target in running.html#sysprops
282 <td><code>ant.build.javac.source</code></td>
283 <td>Source-level version number</td>
284 <td>Default <em>source</em> value for &lt;javac&gt;/&lt;javadoc&gt;</td>
285 </tr>
286 <tr>
287 <td><code>ant.build.javac.target</code></td>
288 <td>Class-compatibility version number</td>
289 <td>Default <em>target</em> value for &lt;javac&gt;</td>
290 </tr>
291 <tr>
810cf6f4 »
2004-08-31 Refactored Target invocation into org.apache.tools.ant.Executor
292 <td><code>ant.executor.class</code></td>
9531796e »
2005-01-13 doc updates; especially command line options, why we hate CLASSPATH a…
293 <td>classname; default is org. apache. tools. ant. helper. DefaultExecutor</td>
810cf6f4 »
2004-08-31 Refactored Target invocation into org.apache.tools.ant.Executor
294 <td><b>Since Ant 1.6.3</b> Ant will delegate Target invocation to the
295 org.apache.tools.ant.Executor implementation specified here.
296 </td>
297 </tr>
9531796e »
2005-01-13 doc updates; especially command line options, why we hate CLASSPATH a…
298
299 <tr>
300 <td><code>ant.file</code></td>
301 <td>read only: full filename of the build file</td>
302 <td>This is set to the name of the build file. In
114eca2b »
2010-05-26 Obliterating "core" vs. "optional" distinction for tasks and types in…
303 <a href="Tasks/import.html">
9531796e »
2005-01-13 doc updates; especially command line options, why we hate CLASSPATH a…
304 &lt;import&gt;-ed</a> files, this is set to the containing build file.
305 </td>
306 </tr>
307
308 <tr>
309 <td><code>ant.file.*</code></td>
310 <td>read only: full filename of the build file of Ant projects
311 </td>
203ebc61 »
2006-10-16 Document two launch options.
312 <td>This is set to the name of a file by project;
114eca2b »
2010-05-26 Obliterating "core" vs. "optional" distinction for tasks and types in…
313 this lets you determine the location of <a href="Tasks/import.html">
203ebc61 »
2006-10-16 Document two launch options.
314 &lt;import&gt;-ed</a> files,
9531796e »
2005-01-13 doc updates; especially command line options, why we hate CLASSPATH a…
315 </td>
316 </tr>
317
810cf6f4 »
2004-08-31 Refactored Target invocation into org.apache.tools.ant.Executor
318 <tr>
1d8cbd40 »
2003-12-03 Add more system properties
319 <td><code>ant.input.properties</code></td>
320 <td>filename (required)</td>
321 <td>Name of the file holding the values for the
322 <a href="inputhandler.html">PropertyFileInputHandler</a>.
323 </td>
324 </tr>
325 <tr>
326 <td><code>ant.logger.defaults</code></td>
327 <!-- add the blank after the slash, so the browser can do a line break -->
328 <td>filename (optional, default '/org/ apache/ tools/ ant/ listener/ defaults.properties')</td>
329 <td>Name of the file holding the color mappings for the
330 <a href="listeners.html#AnsiColorLogger">AnsiColorLogger</a>.
331 </td>
332 </tr>
333 <tr>
334 <td><code>ant.netrexxc.*</code></td>
335 <td>several formats</td>
114eca2b »
2010-05-26 Obliterating "core" vs. "optional" distinction for tasks and types in…
336 <td>Use specified values as defaults for <a href="Tasks/netrexxc.html">netrexxc</a>.
1d8cbd40 »
2003-12-03 Add more system properties
337 </td>
338 </tr>
339 <tr>
340 <td><code>ant.PropertyHelper</code></td>
341 <td>ant-reference-name (optional)</td>
342 <td>Specify the PropertyHelper to use. The object must be of the type
343 org.apache.tools.ant.PropertyHelper. If not defined an object of
344 org.apache.tools.ant.PropertyHelper will be used as PropertyHelper.
345 </td>
346 </tr>
347 <tr>
348 <td><code>ant.regexp.regexpimpl</code></td>
349 <td>classname</td>
9e7a417a »
2009-08-26 More cleanup of pre-1.4 code and docs.
350 <td>classname for a RegExp implementation; if not set Ant uses JDK 1.4's implementation;
114eca2b »
2010-05-26 Obliterating "core" vs. "optional" distinction for tasks and types in…
351 <a href="Types/mapper.html#regexp-mapper">RegExp-Mapper</a>
1d8cbd40 »
2003-12-03 Add more system properties
352 "Choice of regular expression implementation"
353 </td>
354 </tr>
355 <tr>
356 <td><code>ant.reuse.loader</code></td>
357 <td>boolean</td>
358 <td>allow to reuse classloaders
359 used in org.apache.tools.ant.util.ClasspathUtil
360 </td>
361 </tr>
362 <tr>
363 <td><code>ant.XmlLogger.stylesheet.uri</code></td>
364 <td>filename (default 'log.xsl')</td>
365 <td>Name for the stylesheet to include in the logfile by
366 <a href="listeners.html#XmlLogger">XmlLogger</a>.
367 </td>
368 </tr>
369 <tr>
370 <td><code>build.compiler</code></td>
371 <td>name</td>
372 <td>Specify the default compiler to use.
114eca2b »
2010-05-26 Obliterating "core" vs. "optional" distinction for tasks and types in…
373 see <a href="Tasks/javac.html">javac</a>,
374 <a href="Tasks/ejb.html#ejbjar_weblogic">EJB Tasks</a>
1d8cbd40 »
2003-12-03 Add more system properties
375 (compiler attribute),
114eca2b »
2010-05-26 Obliterating "core" vs. "optional" distinction for tasks and types in…
376 <a href="Tasks/javah.html">javah</a>
1d8cbd40 »
2003-12-03 Add more system properties
377 </td>
378 </tr>
379 <tr>
380 <td><code>build.compiler.emacs</code></td>
381 <td>boolean (default false)</td>
382 <td>Enable emacs-compatible error messages.
114eca2b »
2010-05-26 Obliterating "core" vs. "optional" distinction for tasks and types in…
383 see <a href="Tasks/javac.html">javac</a> "Jikes Notes"
1d8cbd40 »
2003-12-03 Add more system properties
384 </td>
385 </tr>
386 <tr>
387 <td><code>build.compiler.fulldepend</code></td>
388 <td>boolean (default false)</td>
389 <td>Enable full dependency checking
114eca2b »
2010-05-26 Obliterating "core" vs. "optional" distinction for tasks and types in…
390 see <a href="Tasks/javac.html">javac</a> "Jikes Notes"
1d8cbd40 »
2003-12-03 Add more system properties
391 </td>
392 </tr>
393 <tr>
394 <td><code>build.compiler.jvc.extensions</code></td>
395 <td>boolean (default true)</td>
396 <td>enable Microsoft extensions of their java compiler
114eca2b »
2010-05-26 Obliterating "core" vs. "optional" distinction for tasks and types in…
397 see <a href="Tasks/javac.html">javac</a> "Jvc Notes"
1d8cbd40 »
2003-12-03 Add more system properties
398 </td>
399 </tr>
400 <tr>
401 <td><code>build.compiler.pedantic</code></td>
402 <td>boolean (default false)</td>
403 <td>Enable pedantic warnings.
114eca2b »
2010-05-26 Obliterating "core" vs. "optional" distinction for tasks and types in…
404 see <a href="Tasks/javac.html">javac</a> "Jikes Notes"
1d8cbd40 »
2003-12-03 Add more system properties
405 </td>
406 </tr>
407 <tr>
408 <td><code>build.compiler.warnings</code></td>
409 <td>Deprecated flag</td>
114eca2b »
2010-05-26 Obliterating "core" vs. "optional" distinction for tasks and types in…
410 <td> see <a href="Tasks/javac.html">javac</a> "Jikes Notes" </td>
1d8cbd40 »
2003-12-03 Add more system properties
411 </tr>
412 <tr>
413 <td><code>build.rmic</code></td>
414 <td>name</td>
114eca2b »
2010-05-26 Obliterating "core" vs. "optional" distinction for tasks and types in…
415 <td>control the <a href="Tasks/rmic.html">rmic</a> compiler </td>
1d8cbd40 »
2003-12-03 Add more system properties
416 </tr>
417 <tr>
418 <td><code>build.sysclasspath</code></td>
95ab604d »
2008-08-20 explain build.sysclasspath only once. PR 39338
419 <td>see <a href="sysclasspath.html">its dedicated page</a>, no
420 default value</td>
421 <td>see <a href="sysclasspath.html">its dedicated page</a></td>
1d8cbd40 »
2003-12-03 Add more system properties
422 </tr>
423 <tr>
424 <td><code>file.encoding</code></td>
425 <td>name of a supported character set (e.g. UTF-8, ISO-8859-1, US-ASCII)</td>
426 <td>use as default character set of email messages; use as default for source-, dest- and bundleencoding
114eca2b »
2010-05-26 Obliterating "core" vs. "optional" distinction for tasks and types in…
427 in <a href="Tasks/translate.html">translate</a> <br>
048064a4 »
2010-08-25 replace java.sun.com links where possible and remove some old cruft
428 see JavaDoc of <a target="_blank" href="http://download.oracle.com/javase/6/docs/api/java/nio/charset/Charset.html">java.nio.charset.Charset</a>
1d8cbd40 »
2003-12-03 Add more system properties
429 for more information about character sets (not used in Ant, but has nice docs).
430 </td>
431 </tr>
432 <tr>
433 <td><code>jikes.class.path</code></td>
434 <td>path</td>
435 <td>The specified path is added to the classpath if jikes is used as compiler.</td>
436 </tr>
437 <tr>
438 <td><code>MailLogger.properties.file, MailLogger.*</code></td>
439 <td>filename (optional, defaults derived from Project instance)</td>
440 <td>Name of the file holding properties for sending emails by the
441 <a href="listeners.html#MailLogger">MailLogger</a>. Override properties set
442 inside the buildfile or via command line.
443 </td>
444 </tr>
445 <tr>
446 <td><code>org.apache.tools.ant.ProjectHelper</code></td>
447 <!-- add the blank after the slash, so the browser can do a line break -->
9531796e »
2005-01-13 doc updates; especially command line options, why we hate CLASSPATH a…
448 <td>classname (optional, default 'org.apache.tools.ant.ProjectHelper')</td>
1d8cbd40 »
2003-12-03 Add more system properties
449 <td>specifies the classname to use as ProjectHelper. The class must extend
450 org.apache.tools.ant.ProjectHelper.
451 </td>
452 </tr>
453 <tr>
454 <td><code>p4.port, p4.client, p4.user</code></td>
455 <td>several formats</td>
456 <td>Specify defaults for port-, client- and user-setting of the
114eca2b »
2010-05-26 Obliterating "core" vs. "optional" distinction for tasks and types in…
457 <a href="Tasks/perforce.html">perforce</a> tasks.
1d8cbd40 »
2003-12-03 Add more system properties
458 </td>
459 </tr>
460 <tr>
add874fa »
2009-09-27 PR 47830 : implementation of the ProjectHelperRepository to make Ant …
461 <td><code>websphere.home</code></td>
1d8cbd40 »
2003-12-03 Add more system properties
462 <td>path</td>
463 <td>Points to home directory of websphere.
114eca2b »
2010-05-26 Obliterating "core" vs. "optional" distinction for tasks and types in…
464 see <a href="Tasks/ejb.html#ejbjar_websphere">EJB Tasks</a>
1d8cbd40 »
2003-12-03 Add more system properties
465 </td>
466 </tr>
467 <tr>
add874fa »
2009-09-27 PR 47830 : implementation of the ProjectHelperRepository to make Ant …
468 <td><code>XmlLogger.file</code></td>
1d8cbd40 »
2003-12-03 Add more system properties
469 <td>filename (default 'log.xml')</td>
470 <td>Name for the logfile for <a href="listeners.html#MailLogger">MailLogger</a>.
471 </td>
472 </tr>
add874fa »
2009-09-27 PR 47830 : implementation of the ProjectHelperRepository to make Ant …
473 <tr>
474 <td><code>ant.project-helper-repo.debug</code></td>
475 <td>boolean (default 'false')</td>
8915a629 »
2012-05-26 Bug 53291 - Several spell checker findings in apache ant 1.8.3 docume…
476 <td>Set it to true to enable debugging with Ant's
add874fa »
2009-09-27 PR 47830 : implementation of the ProjectHelperRepository to make Ant …
477 <a href="projecthelper.html#repository">ProjectHelper internal repository</a>.
478 </td>
479 </tr>
1d8cbd40 »
2003-12-03 Add more system properties
480 </table>
036b72ad »
2003-11-28 Document org.apache.tools.ant.ProjectHelper System property.
481
9531796e »
2005-01-13 doc updates; especially command line options, why we hate CLASSPATH a…
482 <p>
483 If new properties get added (it happens), expect them to appear under the
203ebc61 »
2006-10-16 Document two launch options.
484 "ant." and "org.apache.tools.ant" prefixes, unless the developers have a
485 very good reason to use another prefix. Accordingly, please avoid using
5fb848c2 »
2005-05-09 Spelling/punctuation/wording/etc.
486 properties that begin with these prefixes. This protects you from future
487 Ant releases breaking your build file.
9531796e »
2005-01-13 doc updates; especially command line options, why we hate CLASSPATH a…
488 </p>
ee3794ad »
2005-12-05 Fix for Bugzilla 13655. Thanks to Simon Law. Proper return code for a…
489 <h3>return code</h3>
490 <p>the ant start up scripts (in their Windows and Unix version) return
491 the return code of the java program. So a successful build returns 0,
c0d369f2 »
2007-06-05 pull previous commit
492 failed builds return other values.
ee3794ad »
2005-12-05 Fix for Bugzilla 13655. Thanks to Simon Law. Proper return code for a…
493 </p>
9531796e »
2005-01-13 doc updates; especially command line options, why we hate CLASSPATH a…
494
a7ee627e »
2003-02-01 Additional info about running under Exec and Win9X/ME systems
495 <h2><a name="cygwin">Cygwin Users</a></h2>
2026358f »
2003-04-23 Improve OS/2 support:
496 <p>The Unix launch script that come with Ant works correctly with Cygwin. You
5fb848c2 »
2005-05-09 Spelling/punctuation/wording/etc.
497 should not have any problems launching Ant from the Cygwin shell. It is
498 important to note, however, that once Ant is running it is part of the JDK
499 which operates as a native Windows application. The JDK is not a Cygwin
500 executable, and it therefore has no knowledge of Cygwin paths, etc. In
501 particular when using the <code>&lt;exec&gt;</code> task, executable names such
502 as &quot;/bin/sh&quot; will not work, even though these work from the Cygwin
503 shell from which Ant was launched. You can use an executable name such as
504 &quot;sh&quot; and rely on that command being available in the Windows path.
a7ee627e »
2003-02-01 Additional info about running under Exec and Win9X/ME systems
505 </p>
506
2026358f »
2003-04-23 Improve OS/2 support:
507 <h2><a name="os2">OS/2 Users</a></h2>
5fb848c2 »
2005-05-09 Spelling/punctuation/wording/etc.
508 <p>The OS/2 launch script was developed to perform complex tasks. It has two parts:
509 <code>ant.cmd</code> which calls Ant and <code>antenv.cmd</code> which sets the environment for Ant.
2026358f »
2003-04-23 Improve OS/2 support:
510 Most often you will just call <code>ant.cmd</code> using the same command line options as described
511 above. The behaviour can be modified by a number of ways explained below.</p>
512
513 <p>Script <code>ant.cmd</code> first verifies whether the Ant environment is set correctly. The
514 requirements are:</p>
515 <ol>
516 <li>Environment variable <code>JAVA_HOME</code> is set.</li>
517 <li>Environment variable <code>ANT_HOME</code> is set.</li>
5fb848c2 »
2005-05-09 Spelling/punctuation/wording/etc.
518 <li>Environment variable <code>CLASSPATH</code> is set and contains at least one element from
2026358f »
2003-04-23 Improve OS/2 support:
519 <code>JAVA_HOME</code> and at least one element from <code>ANT_HOME</code>.</li>
520 </ol>
521
522 <p>If any of these conditions is violated, script <code>antenv.cmd</code> is called. This script
523 first invokes configuration scripts if there exist: the system-wide configuration
5fb848c2 »
2005-05-09 Spelling/punctuation/wording/etc.
524 <code>antconf.cmd</code> from the <code>%ETC%</code> directory and then the user configuration
2026358f »
2003-04-23 Improve OS/2 support:
525 <code>antrc.cmd</code> from the <code>%HOME%</code> directory. At this moment both
526 <code>JAVA_HOME</code> and <code>ANT_HOME</code> must be defined because <code>antenv.cmd</code>
527 now adds <code>classes.zip</code> or <code>tools.jar</code> (depending on version of JVM) and
528 everything from <code>%ANT_HOME%\lib</code> except <code>ant-*.jar</code> to
529 <code>CLASSPATH</code>. Finally <code>ant.cmd</code> calls per-directory configuration
530 <code>antrc.cmd</code>. All settings made by <code>ant.cmd</code> are local and are undone when the
531 script ends. The settings made by <code>antenv.cmd</code> are persistent during the lifetime of the
5fb848c2 »
2005-05-09 Spelling/punctuation/wording/etc.
532 shell (of course unless called automatically from <code>ant.cmd</code>). It is thus possible to call
2026358f »
2003-04-23 Improve OS/2 support:
533 <code>antenv.cmd</code> manually and modify some settings before calling <code>ant.cmd</code>.</p>
534
5fb848c2 »
2005-05-09 Spelling/punctuation/wording/etc.
535 <p>Scripts <code>envset.cmd</code> and <code>runrc.cmd</code> perform auxiliary tasks. All scripts
2026358f »
2003-04-23 Improve OS/2 support:
536 have some documentation inside.</p>
537
2d7b1b66 »
2008-07-18 some notes on running Ant as a background process. PR 34461.
538 <h2><a name="background">Running Ant as a background process on
539 Unix(-like) systems</a></h2>
540
541 <p>If you start Ant as a background process (like in <code>ant
add874fa »
2009-09-27 PR 47830 : implementation of the ProjectHelperRepository to make Ant …
542 &amp;</code>) and the build process creates another process, Ant will
2d7b1b66 »
2008-07-18 some notes on running Ant as a background process. PR 34461.
543 immediately try to read from standard input, which in turn will
544 most likely suspend the process. In order to avoid this, you must
545 redirect Ant's standard input or explicitly provide input to each
546 spawned process via the input related attributes of the
547 corresponding tasks.</p>
548
549 <p>Tasks that create such new processes
550 include <code>&lt;exec&gt;</code>, <code>&lt;apply&gt;</code>
551 or <code>&lt;java&gt;</code> when the <code>fork</code> attribute is
552 <code>true</code>.</p>
553
d7b8f747 »
2001-12-13 Add TOCs for Installing, Using, Running, Developing; add some name tags;
554 <h2><a name="viajava">Running Ant via Java</a></h2>
6e4afb17 »
2001-04-10 Move the "Running Ant" section from "Installing Ant" to a page of its…
555 <p>If you have installed Ant in the do-it-yourself way, Ant can be started
5fb848c2 »
2005-05-09 Spelling/punctuation/wording/etc.
556 from one of two entry points:</p>
6e4afb17 »
2001-04-10 Move the "Running Ant" section from "Installing Ant" to a page of its…
557 <blockquote>
558 <pre>java -Dant.home=c:\ant org.apache.tools.ant.Main [options] [target]</pre>
559 </blockquote>
560
00210f39 »
2003-10-02 merge
561 <blockquote>
562 <pre>java -Dant.home=c:\ant org.apache.tools.ant.launch.Launcher [options] [target]</pre>
563 </blockquote>
564
565 <p>
566 The first method runs Ant's traditional entry point. The second method uses
567 the Ant Launcher introduced in Ant 1.6. The former method does not support
568 the -lib option and all required classes are loaded from the CLASSPATH. You must
569 ensure that all required jars are available. At a minimum the CLASSPATH should
570 include:
571 </p>
572
6e4afb17 »
2001-04-10 Move the "Running Ant" section from "Installing Ant" to a page of its…
573 <ul>
00210f39 »
2003-10-02 merge
574 <li><code>ant.jar</code> and <code>ant-launcher.jar</code></li>
6e4afb17 »
2001-04-10 Move the "Running Ant" section from "Installing Ant" to a page of its…
575 <li>jars/classes for your XML parser</li>
576 <li>the JDK's required jar/zip files</li>
577 </ul>
00210f39 »
2003-10-02 merge
578
579 <p>
203ebc61 »
2006-10-16 Document two launch options.
580 The latter method supports the -lib, -nouserlib, -noclasspath options and will
1a1b7738 »
2006-07-13 oh, this feels so good. Removing Win98 as a supported platform. Also …
581 load jars from the specified ANT_HOME. You should start the latter with the most minimal
00210f39 »
2003-10-02 merge
582 classpath possible, generally just the ant-launcher.jar.
583 </p>
584
1a1b7738 »
2006-07-13 oh, this feels so good. Removing Win98 as a supported platform. Also …
585 <a name="viaant"/>
586
7078cd07 »
2006-07-17 remove double can; replace period w/ colon
587 Ant can be started in Ant via the <code>&lt;java&gt;</code> command.
588 Here is an example:
1a1b7738 »
2006-07-13 oh, this feels so good. Removing Win98 as a supported platform. Also …
589
590 <pre>
591 &lt;java
592 classname="org.apache.tools.ant.launch.Launcher"
593 fork="true"
594 failonerror="true"
595 dir="${sub.builddir}"
596 timeout="4000000"
106d0347 »
2006-10-16 Codestyle (indent of bracket) and overwrite the taskname for logging.
597 taskname="startAnt"
598 &gt;
1a1b7738 »
2006-07-13 oh, this feels so good. Removing Win98 as a supported platform. Also …
599 &lt;classpath&gt;
600 &lt;pathelement location="${ant.home}/lib/ant-launcher.jar"/&gt;
601 &lt;/classpath&gt;
602 &lt;arg value="-buildfile"/&gt;
603 &lt;arg file="${sub.buildfile}"/&gt;
604 &lt;arg value="-Dthis=this"/&gt;
605 &lt;arg value="-Dthat=that"/&gt;
606 &lt;arg value="-Dbasedir=${sub.builddir}"/&gt;
607 &lt;arg value="-Dthe.other=the.other"/&gt;
608 &lt;arg value="${sub.target}"/&gt;
609 &lt;/java&gt;
610 </pre>
6e4afb17 »
2001-04-10 Move the "Running Ant" section from "Installing Ant" to a page of its…
611 <br>
f815d39c »
2006-09-11 remove copyright lines that match my fisrt attempt at a regexp
612
6e4afb17 »
2001-04-10 Move the "Running Ant" section from "Installing Ant" to a page of its…
613
614 </body>
e832339a »
2006-10-29 AntUnit 1.0 Beta2
615 </html>
Something went wrong with that request. Please try again.