git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1522924 13f79535-47bb-0310-9956-ffa450edef68master
@@ -48,7 +48,8 @@ Warning: the case of the extension is that of the algorithm used. | |||
If you ask for "SHA1", you get a .SHA1 extension; if you ask for "sha1", you | |||
get a file ending in .sha1. The Java Crypto Engines are case-insensitive | |||
in matching algorithms, so choose a name to match your desired output extension, | |||
or set the <tt>fileext</tt> attribute. | |||
or set the <tt>fileext</tt> attribute. The names of common hashing algorithms can be located on the | |||
<a target="_blank" href="http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#MessageDigest">Cryptography Architecture Standard Algorithm Name Documentation</a> | |||
</p> | |||
<h3>Parameters</h3> | |||
@@ -76,7 +77,7 @@ or set the <tt>fileext</tt> attribute. | |||
<td valign="top">algorithm</td> | |||
<td valign="top">Specifies the algorithm to be used to | |||
compute the checksum. Defaults to "MD5". | |||
Other popular algorithms like "SHA" or "SHA-512" may be used | |||
Other <a target="_blank" href="http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#MessageDigest">popular algorithms</a> like "SHA" or "SHA-512" may be used | |||
as well. | |||
</td> | |||
<td valign="top" align="center">No</td> | |||
@@ -110,8 +110,8 @@ Resource Collection</a>s are used to | |||
<td valign="top">encoding</td> | |||
<td valign="top"> | |||
Specifies the encoding for the input files. Please see <a | |||
href="http://download.oracle.com/javase/1.5.0/docs/guide/intl/encoding.doc.html"> | |||
http://download.oracle.com/javase/1.5.0/docs/guide/intl/encoding.doc.html</a> | |||
href="http://docs.oracle.com/javase/7/docs/technotes/guides/intl/encoding.doc.html"> | |||
Supported Encodings</a> | |||
for a list of possible values. Defaults to the platform's | |||
default character encoding. | |||
</td> | |||
@@ -147,7 +147,7 @@ to a value other than its default, <code>"add"</code>.</b></p> | |||
<tr> | |||
<td valign="top">index</td> | |||
<td valign="top">whether to create an <A | |||
HREF="http://download.oracle.com/javase/1.5.0/docs/guide/jar/jar.html#JAR%20Index">index | |||
HREF="http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html#JAR_Index">index | |||
list</A> to speed up classloading. This is a JDK 1.3+ specific | |||
feature. Unless you specify additional jars with nested <a | |||
href="jar.html#indexjars"><code>indexjars</code></a> elements, only the | |||
@@ -160,9 +160,9 @@ to a value other than its default, <code>"add"</code>.</b></p> | |||
<td valign="top">whether to include META-INF and its children in | |||
the index. Doesn't have any effect if <em>index</em> is | |||
false.<br/> | |||
Sun's jar implementation used to skip the META-INF directory and | |||
Oracle's jar implementation used to skip the META-INF directory and | |||
Ant followed that example. The behavior has been changed with | |||
<a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4408526">Java | |||
<a href="https://bugs.openjdk.java.net/browse/JDK-4408526">Java | |||
5</a>. In order to avoid problems with Ant generated jars on | |||
Java 1.4 or earlier Ant will not include META-INF unless | |||
explicitly asked to.<br/> | |||
@@ -62,7 +62,7 @@ ignored</p> | |||
<tr> | |||
<td valign="top">append</td> | |||
<td valign="top">Append to an existing file (or | |||
<a href="http://download.oracle.com/javase/6/docs/api/java/io/FileWriter.html#FileWriter%28java.lang.String,%20boolean%29" target="_blank"> | |||
<a href="http://docs.oracle.com/javase/7/docs/api//java/io/FileWriter.html#FileWriter%28java.lang.String,%20boolean%29" target="_blank"> | |||
open a new file / overwrite an existing file</a>)? Default <i>false</i>. | |||
</td> | |||
<td valign="top" align="center">No; ignored unless <i>output</i> indicates a | |||
@@ -1294,7 +1294,7 @@ This step can be performed by the websphere element as part of the jar generatio | |||
switch <code>ejbdeploy</code> is on, the ejbdeploy tool from the websphere toolset is called for | |||
every ejb-jar. Unfortunately, this step only works, if you use the ibm jdk. Otherwise, the rmic | |||
(called by ejbdeploy) throws a ClassFormatError. Be sure to switch ejbdeploy off, if run ant with | |||
sun jdk. | |||
Oracle JDK or OpenJDK. | |||
</p> | |||
<p> | |||
@@ -88,8 +88,8 @@ running is a standard Windows executable and is not aware of the Cygwin | |||
environment (i.e., doesn't load <code>cygwin1.dll</code>). The only | |||
work-around for this is to compile a JVM under Cygwin (at your own risk). | |||
See for instance | |||
<a href="http://java.sun.com/javase/6/docs/build/README-builds.html#cygwin"> | |||
sun jdk 6 build instructions for cygwin</a>. | |||
<a href="http://hg.openjdk.java.net/jdk7/build/raw-file/tip/README-builds.html#cygwin"> | |||
OpenJDK build instructions for cygwin</a>. | |||
</p> | |||
<h4>OpenVMS Users</h4> | |||
@@ -303,7 +303,7 @@ try to set up a new connection.</p> | |||
<tr> | |||
<td valign="top">serverTimeZoneConfig</td> | |||
<td valign="top">Specify as a Java | |||
<a href="http://download.oracle.com/javase/6/docs/api/java/util/TimeZone.html"> | |||
<a href="http://docs.oracle.com/javase/7/docs/api//java/util/TimeZone.html"> | |||
TimeZone</a> identifier, (e.g. <code>GMT</code>, <code>America/Chicago</code> or | |||
<code>Asia/Jakarta</code>) the timezone used by the server for timestamps. This | |||
enables timestamp dependency checking even when the server is in a different | |||
@@ -318,7 +318,7 @@ try to set up a new connection.</p> | |||
<td valign="top">defaultDateFormatConfig</td> | |||
<td valign="top">Specify in Java | |||
<a href="http://download.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html"> | |||
<a href="http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html"> | |||
SimpleDateFormat</a> notation, (e.g. | |||
<code>yyyy-MM-dd</code>), the date format generally used by the FTP server | |||
to parse dates. In some cases this will be the only date format used. | |||
@@ -335,7 +335,7 @@ try to set up a new connection.</p> | |||
<tr> | |||
<td valign="top">recentDateFormatConfig</td> | |||
<td valign="top">Specify in Java | |||
<a href="http://download.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html"> | |||
<a href="http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html"> | |||
SimpleDateFormat</a> notation, | |||
(e.g. <code>MMM dd hh:mm</code>) the date format used by the FTP server | |||
to parse dates less than a year old. If not specified (or specified as | |||
@@ -33,11 +33,10 @@ If the extension is present then a property is set.</p> | |||
works with extensions as defined by the "Optional Package" specification. | |||
For more information about optional packages, see the document | |||
<em>Optional Package Versioning</em> in the documentation bundle for your | |||
Java2 Standard Edition package, in file | |||
<code>guide/extensions/versioning.html</code> or online at | |||
<a href="http://download.oracle.com/javase/1.3/docs/guide/extensions/versioning.html"> | |||
http://download.oracle.com/javase/1.3/docs/guide/extensions/versioning.html | |||
<p>See the Extension and ExtensionSet documentation for further details</p> | |||
Java Standard Edition package, in file | |||
<code>guide/extensions/versioning.html</code> or the online | |||
<a target="_blank" href="http://docs.oracle.com/javase/7/docs/technotes/guides/extensions/versioning.html"> | |||
Extension and ExtensionSet documentation</a> for further details</p> | |||
<h3>Parameters</h3> | |||
<table border="1" cellpadding="2" cellspacing="0"> | |||
@@ -33,11 +33,10 @@ | |||
works with extensions as defined by the "Optional Package" specification. | |||
For more information about optional packages, see the document | |||
<em>Optional Package Versioning</em> in the documentation bundle for your | |||
Java2 Standard Edition package, in file | |||
<code>guide/extensions/versioning.html</code> or online at | |||
<a href="http://download.oracle.com/javase/1.3/docs/guide/extensions/versioning.html"> | |||
http://download.oracle.com/javase/1.3/docs/guide/extensions/versioning.html | |||
<p>See the Extension and ExtensionSet documentation for further details</p> | |||
Java Standard Edition package, in file | |||
<code>guide/extensions/versioning.html</code> or the online | |||
<a target="_blank" href="http://docs.oracle.com/javase/7/docs/technotes/guides/extensions/versioning.html"> | |||
Extension and ExtensionSet documentation</a> for further details</p> | |||
<h3>Parameters</h3> | |||
<table border="1" cellpadding="2" cellspacing="0"> | |||
@@ -35,11 +35,10 @@ | |||
works with extensions as defined by the "Optional Package" specification. | |||
For more information about optional packages, see the document | |||
<em>Optional Package Versioning</em> in the documentation bundle for your | |||
Java2 Standard Edition package, in file | |||
<code>guide/extensions/versioning.html</code> or online at | |||
<a href="http://download.oracle.com/javase/1.3/docs/guide/extensions/versioning.html"> | |||
http://download.oracle.com/javase/1.3/docs/guide/extensions/versioning.html | |||
<p>See the Extension and ExtensionSet documentation for further details</p> | |||
Java Standard Edition package, in file | |||
<code>guide/extensions/versioning.html</code> or the online | |||
<a target="_blank" href="http://docs.oracle.com/javase/7/docs/technotes/guides/extensions/versioning.html"> | |||
Extension and ExtensionSet documentation</a> for further details</p> | |||
<h3>Parameters</h3> | |||
<table border="1" cellpadding="2" cellspacing="0"> | |||
@@ -39,10 +39,9 @@ works with extensions as defined by the "Optional Package" specification. | |||
For more information about optional packages, see the document | |||
<em>Optional Package Versioning</em> in the documentation bundle for your | |||
Java2 Standard Edition package, in file | |||
<code>guide/extensions/versioning.html</code> or online at | |||
<a href="http://download.oracle.com/javase/1.3/docs/guide/extensions/versioning.html"> | |||
http://download.oracle.com/javase/1.3/docs/guide/extensions/versioning.html | |||
<p>See the Extension and ExtensionSet documentation for further details</p> | |||
<code>guide/extensions/versioning.html</code> or the online | |||
<a target="_blank" href="http://docs.oracle.com/javase/7/docs/technotes/guides/extensions/versioning.html"> | |||
Extension and ExtensionSet documentation</a> for further details</p> | |||
<h3>Parameters</h3> | |||
<table border="1" cellpadding="2" cellspacing="0"> | |||
@@ -321,7 +321,7 @@ task is run. If you need to locate a JAR file relative to the directory | |||
the task will be run in, you need to explicitly create the full path | |||
to the JAR file.</p> | |||
<p>When using the <tt>jar</tt> attribute, all classpath settings are | |||
ignored according to <a href="http://download.oracle.com/javase/1.5.0/docs/tooldocs/windows/java.html#-jar">Sun's | |||
ignored according to <a href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/java.html">Oracle's | |||
specification</a>. | |||
@@ -61,7 +61,7 @@ to ensure that this command supports the attributes you wish to use.</p> | |||
<p><b>Note:</b><br>When generating the JavaDocs for classes which contains annotations | |||
you maybe get a <tt>java.lang.ClassCastException: com.sun.tools.javadoc.ClassDocImpl</tt>. | |||
This is due <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6442982" target="_blank">bug-6442982</a>. The cause is that JavaDoc cannot find the implementations of used annotations. | |||
This is due <a href="https://bugs.openjdk.java.net/browse/JDK-6442982" target="_blank">bug-6442982</a>. The cause is that JavaDoc cannot find the implementations of used annotations. | |||
The workaround is providing the jars with these implementations (like JAXBs <tt>@XmlType</tt>, ...) | |||
to <javadoc> using <tt>classpath</tt>, <tt>classpathref</tt> attributes or nested | |||
<classpath> element.</p> | |||
@@ -515,7 +515,7 @@ to <javadoc> using <tt>classpath</tt>, <tt>classpathref</tt> attributes or | |||
order to mitigate CVE-2013-1571. Defaults to true. <em>Since Ant | |||
1.9.2</em><br></td> | |||
There is a frame injection attack possible in javadocs generated by Oracle | |||
JDKs prior to Java7 Update 25. When this flag is set to true, Ant | |||
JDKs prior to Java7 Update 25 (<a href="http://www.oracle.com/technetwork/java/javase/7u25-relnotes-1955741.html#jpi-upt" target="_blank">details</a>). When this flag is set to true, Ant | |||
will check whether the docs are vulnerable and will try to fix them. | |||
</td> | |||
<td align="center" valign="top">1.4</td> | |||
@@ -715,7 +715,7 @@ with text contents, and the packages may be listed with nested | |||
<h4>doclet</h4> | |||
<p>The doclet nested element is used to specify the | |||
<a href="http://download.oracle.com/javase/1.4.2/docs/tooldocs/javadoc/overview.html">doclet</a> | |||
<a href="http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/doclet/overview.html">doclet</a> | |||
that javadoc will use to process the input source files. A number of the standard javadoc arguments | |||
are actually arguments of the standard doclet. If these are specified in the javadoc | |||
task's attributes, they will be passed to the doclet specified in the | |||
@@ -779,7 +779,7 @@ not set the description attribute for those tags.</p> | |||
<td valign="top">If this attribute is specified, this element will behave as an implicit | |||
<a href="../Types/fileset.html">fileset</a>. The files included by this fileset should | |||
contain each tag definition on a separate line, as described in the | |||
<a href="http://download.oracle.com/javase/1.4.2/docs/tooldocs/windows/javadoc.html#tag">Javadoc reference guide</a>: | |||
<a href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#javadoctags">Javadoc reference guide</a>: | |||
<pre>ejb.bean:t:XDoclet EJB Tag | |||
todo:a:To Do</pre> | |||
<b>Note:</b> The Javadoc reference quide has double quotes around | |||
@@ -796,7 +796,7 @@ the javadoc program. | |||
<h4><a name="tagletelement">taglet</a></h4> | |||
<p>The taglet nested element is used to specify custom | |||
<a href="http://download.oracle.com/javase/1.4.2/docs/tooldocs/javadoc/taglet/overview.html">taglets</a>.</p> | |||
<a href="http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/taglet/overview.html">taglets</a> beyond <a href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#javadoctags" target="_blank">the default taglets</a>.</p> | |||
<h5>Parameters</h5> | |||
<table width="90%" border="1" cellpadding="2" cellspacing="0"> | |||
@@ -808,7 +808,7 @@ the javadoc program. | |||
<tr> | |||
<td valign="top">name</td> | |||
<td valign="top">The name of the taglet class | |||
(e.g. <a href="http://download.oracle.com/javase/1.4.2/docs/tooldocs/javadoc/taglet/ToDoTaglet.java"> | |||
(e.g. <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/javadoc/taglet/ToDoTaglet.java"> | |||
<code>com.sun.tools.doclets.ToDoTaglet</code></a>)</td> | |||
<td align="center" valign="top">Yes</td> | |||
</tr> | |||
@@ -849,8 +849,8 @@ arguments</a>. <em>Since Ant 1.6</em></p> | |||
<tag name="todo" scope="all" description="To do:"/> | |||
<group title="Group 1 Packages" packages="com.dummy.test.a*"/> | |||
<group title="Group 2 Packages" packages="com.dummy.test.b*:com.dummy.test.c*"/> | |||
<link offline="true" href="http://download.oracle.com/javase/6/docs/api/" packagelistLoc="C:\tmp"/> | |||
<link href="http://developer.java.sun.com/developer/products/xml/docs/api/"/> | |||
<link offline="true" href="http://docs.oracle.com/javase/7/docs/api/" packagelistLoc="C:\tmp"/> | |||
<link href="http://docs.oracle.com/javase/7/docs/api/"/> | |||
</javadoc></pre> | |||
<p>is the same as</p> | |||
@@ -872,8 +872,8 @@ arguments</a>. <em>Since Ant 1.6</em></p> | |||
<tag name="todo" scope="all" description="To do:"/> | |||
<group title="Group 1 Packages" packages="com.dummy.test.a*"/> | |||
<group title="Group 2 Packages" packages="com.dummy.test.b*:com.dummy.test.c*"/> | |||
<link offline="true" href="http://download.oracle.com/javase/6/docs/api/" packagelistLoc="C:\tmp"/> | |||
<link href="http://developer.java.sun.com/developer/products/xml/docs/api/"/> | |||
<link offline="true" href="http://docs.oracle.com/javase/7/docs/api/" packagelistLoc="C:\tmp"/> | |||
<link href="http://docs.oracle.com/javase/7/docs/api/"/> | |||
</javadoc></pre> | |||
<p>or</p> | |||
@@ -895,8 +895,8 @@ arguments</a>. <em>Since Ant 1.6</em></p> | |||
<tag name="todo" scope="all" description="To do:"/> | |||
<group title="Group 1 Packages" packages="com.dummy.test.a*"/> | |||
<group title="Group 2 Packages" packages="com.dummy.test.b*:com.dummy.test.c*"/> | |||
<link offline="true" href="http://download.oracle.com/javase/6/docs/api/" packagelistLoc="C:\tmp"/> | |||
<link href="http://developer.java.sun.com/developer/products/xml/docs/api/"/> | |||
<link offline="true" href="http://docs.oracle.com/javase/7/docs/api/" packagelistLoc="C:\tmp"/> | |||
<link href="http://docs.oracle.com/javase/7/docs/api/"/> | |||
</javadoc></pre> | |||
@@ -29,8 +29,8 @@ | |||
<p>Generates JNI headers from a Java class.</p> | |||
<p> When this task executes, it will generate the C header and source files that | |||
are needed to implement native methods. JNI operates differently depending on | |||
whether <a href="http://download.oracle.com/javase/1.3/docs/tooldocs/win32/javah.html">JDK1.2</a> | |||
(or later) or <a href="http://java.sun.com/products/jdk/1.1/docs/tooldocs/win32/javah.html">pre-JDK1.2</a> | |||
whether <a href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javah.html">JDK1.2+</a> | |||
or <a href="http://java.sun.com/products/jdk/1.1/docs/tooldocs/win32/javah.html">pre-JDK1.2</a> | |||
systems are used.</p> | |||
<p>It is possible to use different compilers. This can be selected | |||
@@ -34,7 +34,7 @@ replacing or updating an existing file.</p> | |||
<p>Manifests are processed according to the | |||
<a href="http://download.oracle.com/javase/1.5.0/docs/guide/jar/jar.html">Jar | |||
<a href="http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html">Jar | |||
file specification.</a>. Specifically, a manifest element consists of | |||
a set of attributes and sections. These sections in turn may contain | |||
attributes. Note in particular that this may result in manifest lines | |||
@@ -169,21 +169,21 @@ href="#attribute">attribute</a> elements into sections.</p> | |||
attribute will take the value of the Ant property ${user.name}. The | |||
same is true for the ${version} and ${TODAY} properties. This example | |||
produces a MANIFEST.MF that contains | |||
<a href="http://docs.oracle.com/javase/1.5.0/docs/guide/versioning/">package | |||
<a href="http://docs.oracle.com/javase/7/docs/technotes/guides/versioning/spec/versioning2.html#wp90779">package | |||
version identification</a> for the package <code>common</code>.</p> | |||
<p>The manifest produced by the above would look like this:</p> | |||
<pre><code>Manifest-Version: 1.0 | |||
Built-By: bodewig | |||
Created-By: Apache Ant 1.7 | |||
Created-By: Apache Ant 1.9 | |||
Name: common | |||
Specification-Title: Example | |||
Specification-Vendor: Example Organization | |||
Implementation-Vendor: Example Corp. | |||
Specification-Version: 1.2 | |||
Implementation-Version: 1.2 February 19 2006 | |||
Implementation-Version: 1.2 September 10, 2013 | |||
Implementation-Title: common | |||
Name: common/class1.class | |||
@@ -31,7 +31,7 @@ | |||
<h3>Description</h3> | |||
<p>Sends SMTP mail with MIME attachments. | |||
<a href="http://www.oracle.com/technetwork/java/index-jsp-139225.html">JavaMail</a> | |||
<a href="http://www.oracle.com/technetwork/java/index-138643.html">JavaMail</a> | |||
and <a href="http://www.oracle.com/technetwork/java/javase/jaf-135115.html">Java | |||
Activation Framework</a> are required for this task.</p> | |||
<p>Multiple files can be attached using <a href="../Types/fileset.html">FileSets.</a></p> | |||
@@ -269,12 +269,10 @@ about this feature | |||
<li>If the file is not there, nothing is printed except at -verbose log | |||
level. This lets you have optional configuration files for every | |||
project, that team members can customize. | |||
<li>The rules for this format are laid down | |||
<a href="http://download.oracle.com/javase/6/docs/api/java/util/Properties.html#load%28java.io.InputStream%29">by Sun</a>. | |||
This makes it hard for Team Ant to field bug reports about it. | |||
<li>Trailing spaces are not stripped. It may have been what you wanted. | |||
<li>Want unusual characters? Escape them \u0456 or \" style. | |||
<li>Ant Properties are expanded in the file | |||
<li>The rules for this format match <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Properties.html#load%28java.io.InputStream%29">java.util.Properties</a>.</li> | |||
<li>Trailing spaces are not stripped. It may have been what you wanted.</li> | |||
<li>Want unusual characters? Escape them \u0456 or \" style.</li> | |||
<li>Ant Properties are expanded in the file</li> | |||
<li>If you want to expand properties defined inside the same file and | |||
you use the prefix attribute of the task, you must use the same | |||
prefix when expanding the properties or | |||
@@ -294,7 +292,7 @@ deploy.url=http://${deploy.server}:${deploy.port}/ | |||
<a name="notes-env"></a> | |||
<h3>Notes about environment variables</h3> | |||
<p> | |||
Ant runs on Java 1.2 therefore it cant use Java5 features for accessing environment | |||
Ant runs on Java 1.2 therefore it cannot use Java5 features for accessing environment | |||
variables. So it starts a command in a new process which prints the environment variables, | |||
analyzes the output and creates the properties. <br> | |||
There are commands for the following operating systems implemented in | |||
@@ -180,7 +180,7 @@ and <b>abort</b> execution and transaction and fail task.</p> | |||
<td width="78%" valign="top">Control whether the Java statement | |||
object will perform escape substitution.<br> | |||
See <a | |||
href="http://download.oracle.com/javase/6/docs/api/java/sql/Statement.html#setEscapeProcessing%28boolean%29">Statement's | |||
href="http://docs.oracle.com/javase/7/docs/api/java/sql/Statement.html#setEscapeProcessing%28boolean%29">Statement's | |||
API docs</a> for details. <em>Since Ant 1.6</em>. | |||
<td width="10%" valign="top">No (default=true)</td> | |||
</tr> | |||
@@ -58,7 +58,7 @@ probably in an initialization target.</p> | |||
The Tstamp task supports a <code><format></code> nested element that | |||
allows a property to be set to the current date and time in a given format. | |||
The date/time patterns are as defined in the Java | |||
<a href="http://download.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html">SimpleDateFormat</a> class. | |||
<a href="http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html">SimpleDateFormat</a> class. | |||
The format element also allows offsets to be applied to the time to generate different time values. | |||
<br><br> | |||
<table width="60%" border="1" cellpadding="2" cellspacing="0"> | |||
@@ -81,7 +81,7 @@ The format element also allows offsets to be applied to the time to generate dif | |||
</tr> | |||
<tr> | |||
<td valign="top">timezone</td> | |||
<td valign="top">The timezone to use for displaying time. The values are as defined by the Java <a href="http://download.oracle.com/javase/6/docs/api/java/util/TimeZone.html">TimeZone</a> class.</td> | |||
<td valign="top">The timezone to use for displaying time. The values are as defined by the Java <a href="http://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html">TimeZone</a> class.</td> | |||
<td align="center" valign="top">No</td> | |||
</tr> | |||
<tr> | |||
@@ -112,7 +112,7 @@ The format element also allows offsets to be applied to the time to generate dif | |||
form is "language, country, variant" but either variant or variant and | |||
country may be omitted. For more information please refer to documentation | |||
for the | |||
<a href="http://download.oracle.com/javase/6/docs/api/java/util/Locale.html">Locale</a> | |||
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Locale.html">Locale</a> | |||
class.</td> | |||
<td align="center" valign="top">No</td> | |||
</tr> | |||
@@ -65,7 +65,7 @@ | |||
<p>If you are defining tasks or types that share the same classpath | |||
with multiple taskdef or typedef tasks, the corresponding classes | |||
will be loaded by different | |||
Java <a href="http://download.oracle.com/javase/1.4.2/docs/api/java/lang/ClassLoader.html">ClassLoaders</a>. | |||
Java <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/ClassLoader.html">ClassLoaders</a>. | |||
Two classes with the same name loaded via different ClassLoaders | |||
are not the same class from the point of view of the Java VM, they | |||
don't share static variables and instances of these classes can't | |||
@@ -103,8 +103,8 @@ archive.</p> | |||
<td valign="top"><b>Note:</b> This attribute is not available for | |||
the <code>untar</code> task.<br> | |||
The character encoding that has been used for filenames | |||
inside the zip file. For a list of possible values see <a | |||
href="http://download.oracle.com/javase/1.5.0/docs/guide/intl/encoding.doc.html">http://download.oracle.com/javase/1.5.0/docs/guide/intl/encoding.doc.html</a>.<br> | |||
inside the zip file. For a list of possible values see the <a | |||
href="http://docs.oracle.com/javase/7/docs/technotes/guides/intl/encoding.doc.html">Supported Encodings</a>.<br/> | |||
Defaults to "UTF8", use the magic value | |||
<code>native-encoding</code> for the platform's default character | |||
encoding. | |||
@@ -148,8 +148,8 @@ archive.</p> | |||
<tr> | |||
<td valign="top">encoding</td> | |||
<td valign="top">The character encoding to use for filenames | |||
inside the zip file. For a list of possible values see <a | |||
href="http://download.oracle.com/javase/1.5.0/docs/guide/intl/encoding.doc.html">http://download.oracle.com/javase/1.5.0/docs/guide/intl/encoding.doc.html</a>. | |||
inside the zip file. For a list of possible values see the <a | |||
href="http://docs.oracle.com/javase/7/docs/technotes/guides/intl/encoding.doc.html">Supported Encodings</a>.<br/> | |||
Defaults to the platform's default character encoding. | |||
<br/>See also the <a href="#encoding">discussion below</a></td> | |||
<td align="center" valign="top">No</td> | |||
@@ -33,9 +33,9 @@ in <a href="../Tasks/java.html"><code><java></code></a> and | |||
<p> | |||
Assertions are covered in the | |||
<a href="http://download.oracle.com/javase/1.4.2/docs/guide/lang/assert.html">J2SDK 1.4 documentation</a>, | |||
<a href="http://docs.oracle.com/javase/7/docs/technotes/guides/language/assert.html">Java SE documentation</a>, | |||
and the | |||
<a href="http://java.sun.com/docs/books/jls/assert-spec.html">Java Language Specification</a>. | |||
<a href="http://docs.oracle.com/javase/specs/jls/se7/html/jls-14.html#jls-14.10">Java Language Specification</a>. | |||
<p> | |||
The key points to note are that a <tt>java.lang.AssertionError</tt> | |||
@@ -31,9 +31,9 @@ works with extensions as defined by the "Optional Package" specification. | |||
For more information about optional packages, see the document | |||
<em>Optional Package Versioning</em> in the documentation bundle for your | |||
Java2 Standard Edition package, in file | |||
<code>guide/extensions/versioning.html</code> or online at | |||
<a href="http://download.oracle.com/javase/1.3/docs/guide/extensions/versioning.html"> | |||
http://download.oracle.com/javase/1.3/docs/guide/extensions/versioning.html.</p> | |||
<code>guide/extensions/versioning.html</code> or the online | |||
<a href="http://docs.oracle.com/javase/7/docs/technotes/guides/versioning/spec/versioning2.html#wp90779"> | |||
Package Versioning documentation.</p> | |||
<h3>Attributes</h3> | |||
<p>The extension type supports the following attributes</a>: | |||
@@ -30,8 +30,8 @@ works with extensions as defined by the "Optional Package" specification. | |||
<em>Optional Package Versioning</em> in the documentation bundle for your | |||
Java2 Standard Edition package, in file | |||
<code>guide/extensions/versioning.html</code> or online at | |||
<a href="http://download.oracle.com/javase/1.3/docs/guide/extensions/versioning.html"> | |||
http://download.oracle.com/javase/1.3/docs/guide/extensions/versioning.html.</p> | |||
<a href="http://docs.oracle.com/javase/7/docs/technotes/guides/versioning/spec/versioning2.html#wp90779"> | |||
Package Versioning documentation.</p> | |||
<h3>Nested Elements</h3> | |||
@@ -58,7 +58,7 @@ Use the regular expression with id myregexp. | |||
<p> | |||
Apache Ant comes with | |||
wrappers for | |||
<a href="http://download.oracle.com/javase/6/docs/api/java/util/regex/package-summary.html" target="_top">the java.util.regex package</a>, | |||
<a href="http://docs.oracle.com/javase/7/docs/api/java/util/regex/package-summary.html" target="_top">the java.util.regex package</a>, | |||
<a href="http://attic.apache.org/projects/jakarta-regexp.html" target="_top">jakarta-regexp</a> | |||
and <a href="http://attic.apache.org/projects/jakarta-oro.html" target="_top">jakarta-ORO</a>, | |||
See <a href="../install.html#librarydependencies">installation dependencies</a> | |||
@@ -92,8 +92,8 @@ directories. Default is 755. <em>since Ant 1.5.2</em>.</td> | |||
<tr> | |||
<td valign="top">encoding</td> | |||
<td valign="top">The character encoding to use for filenames | |||
inside the zip file. For a list of possible values see <a | |||
href="http://download.oracle.com/javase/1.5.0/docs/guide/intl/encoding.doc.html">http://download.oracle.com/javase/1.5.0/docs/guide/intl/encoding.doc.html</a>. | |||
inside the zip file. For a list of possible values see the <a | |||
href="http://docs.oracle.com/javase/7/docs/technotes/guides/intl/encoding.doc.html">Supported Encodings</a>. | |||
Defaults to the platform's default character encoding. | |||
<b>Only supported by zipfileset.</b></td> | |||
<td align="center" valign="top">No</td> | |||
@@ -238,8 +238,8 @@ that tend to work best. As of Ant1.7, Windows 9x is no longer supported. | |||
<p> | |||
For the current version of Ant, you will also need a JDK installed on | |||
your system, version 1.4 or later required, 1.5 or later strongly recommended. | |||
The later the version of Java , the more Ant tasks you get. | |||
your system, version 1.4 or later required, 1.7 or later strongly recommended. | |||
The more up-to-date the version of Java , the more Ant tasks you get. | |||
</p> | |||
<p> | |||
<strong>Note: </strong>If a JDK is not present, only the JRE runtime, then many tasks will not work. | |||
@@ -252,10 +252,9 @@ The later the version of Java , the more Ant tasks you get. | |||
<h3>Open Source Java Runtimes</h3> | |||
<p> | |||
The Ant team strongly supports users running Ant on Kaffe and other | |||
The Ant team strongly supports users running Ant on <a target="_blank" href="http://openjdk.java.net/">OpenJDK</a> and other | |||
open source Java runtimes, and so strives to have a product that works | |||
well on those platforms. What appears to work well is Kaffe with | |||
Gnu Classpath and the Xerces and Xalan libraries. | |||
well on those platforms. | |||
</p> | |||
<hr> | |||
<h2><a name="installing">Installing Ant</a></h2> | |||
@@ -369,7 +368,7 @@ Build failed | |||
So Ant works. This message is there because you need to write an individual buildfile for your | |||
project. With a <tt>ant -version</tt> you should get an output like | |||
<pre> | |||
Apache Ant version 1.7.1 compiled on June 27 2008 | |||
Apache Ant(TM) version 1.9.2 compiled on July 8 2013 | |||
</pre> | |||
</p> | |||
<p>If this does not work ensure your environment variables are set right. They must resolve to: | |||
@@ -448,7 +447,7 @@ libraries must be added to Ant's classpath, in any of the following ways: | |||
<blockquote> | |||
<pre>ant -f fetch.xml -Ddest=<i>[option]</i></pre> | |||
</blockquote | |||
</blockquote> | |||
<p> | |||
where option is one of the following, as described above: | |||
@@ -552,10 +551,10 @@ this. </p> | |||
<ul> | |||
<li><b>With Java1.5</b><br> | |||
<li><b>With Java1.5 or above</b><br> | |||
<p> | |||
When you run Ant on Java1.5, you could try to use the automatic proxy setup | |||
When you run Ant on Java1.5 or above, you could try to use the automatic proxy setup | |||
mechanism with <code>-autoproxy</code>. | |||
</p> | |||
@@ -563,8 +562,8 @@ mechanism with <code>-autoproxy</code>. | |||
<li><b>With explicit JVM properties.</b><br> | |||
<p> | |||
These are documented <a | |||
href="http://download.oracle.com/javase/1.5.0/docs/guide/net/properties.html" target="_top">by Oracle</a>, | |||
These are documented in <a | |||
href="http://docs.oracle.com/javase/7/docs/technotes/guides/net/properties.html" target="_top">Java's Networking Properties</a>, | |||
and control the proxy behaviour of the entire JVM. To set them in Ant, declare | |||
them in the <code>ANT_OPTS</code> environment variable. This is the best option | |||
for a non-mobile system. For a laptop, you have to change these settings as you | |||
@@ -629,19 +628,19 @@ configuring the JVM properties until they are happy. </p> | |||
<p>Assume Ant is installed in <code>c:\ant\</code>. The following sets up the | |||
environment:</p> | |||
<pre>set ANT_HOME=c:\ant | |||
set JAVA_HOME=c:\jdk-1.5.0.05 | |||
set JAVA_HOME=c:\jdk1.7.0_51 | |||
set PATH=%PATH%;%ANT_HOME%\bin</pre> | |||
<h3><a name="bash">Linux/Unix (bash)</a></h3> | |||
<p>Assume Ant is installed in <code>/usr/local/ant</code>. The following sets up | |||
the environment:</p> | |||
<pre>export ANT_HOME=/usr/local/ant | |||
export JAVA_HOME=/usr/local/jdk-1.5.0.05 | |||
export JAVA_HOME=/usr/local/jdk1.7.0_51 | |||
export PATH=${PATH}:${ANT_HOME}/bin</pre> | |||
<h3><a name="tcshcsh">Linux/Unix (csh)</a></h3> | |||
<pre>setenv ANT_HOME /usr/local/ant | |||
setenv JAVA_HOME /usr/local/jdk/jdk-1.5.0.05 | |||
setenv JAVA_HOME /usr/local/jdk/jdk1.7.0_51 | |||
set path=( $path $ANT_HOME/bin )</pre> | |||
<p> | |||
@@ -732,7 +731,7 @@ See <a href="#installing">Installing Ant</a> | |||
for examples on how to do this for your operating system. </p> | |||
<p><b>Note</b>: The bootstrap process of Ant requires a greedy | |||
compiler like Sun's javac or jikes. It does not work with gcj or | |||
compiler like OpenJDK or Oracle's javac. It does not work with gcj or | |||
kjc.</p> | |||
<p>Make sure you have downloaded any auxiliary jars required to | |||
@@ -986,8 +985,8 @@ you need jakarta-oro 2.0.8 or later, and <a href="#commons-net">commons-net</a>< | |||
<tr> | |||
<td>mail.jar</td> | |||
<td>Mail task with Mime encoding, and the MimeMail task</td> | |||
<td><a href="http://www.oracle.com/technetwork/java/index-jsp-139225.html" | |||
target="_top">http://www.oracle.com/technetwork/java/index-jsp-139225.html</a></td> | |||
<td><a href="http://www.oracle.com/technetwork/java/index-138643.html" | |||
target="_top">http://www.oracle.com/technetwork/java/index-138643.html</a></td> | |||
</tr> | |||
<tr> | |||
<td>activation.jar</td> | |||
@@ -57,7 +57,7 @@ | |||
example, <code>${os.name}</code> expands to the name of the | |||
operating system.</p> | |||
<p>For a list of system properties see | |||
<a href="http://download.oracle.com/javase/6/docs/api/java/lang/System.html#getProperties%28%29">the Javadoc of System.getProperties</a>. | |||
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/System.html#getProperties%28%29">the Javadoc of System.getProperties</a>. | |||
</p> | |||
<p>In addition, Ant has some built-in properties:</p> | |||
@@ -78,8 +78,8 @@ ant.project.invoked-targets | |||
an <ant> task ...) when invoking the current | |||
project. | |||
ant.java.version the JVM version Ant detected; currently it can hold | |||
the values "1.2", "1.3", | |||
"1.4", "1.5" and "1.6". | |||
the values "1.7", "1.6", "1.5", | |||
"1.4", "1.3" and "1.2". | |||
ant.core.lib the absolute path of the <code>ant.jar</code> file. | |||
</pre> | |||
@@ -87,8 +87,7 @@ proxy configuration. | |||
<h4>How Autoproxy works</h4> | |||
<p> | |||
We are grateful for some input from Sun as to how the proxy code works under | |||
Java 1.5 and up. The <code>java.net.useSystemProxies</code> is checked only | |||
The <code>java.net.useSystemProxies</code> is checked only | |||
once, at startup time, the other checks (registry, gconf, system properties) are done | |||
dynamically whenever needed (socket connection, URL connection etc..). | |||
</p> | |||
@@ -284,10 +283,8 @@ use one of the alternate mechanisms to configure the JVM. | |||
<h4>Further reading</h4> | |||
<ul> | |||
<li><a href="http://download.oracle.com/javase/1.5.0/docs/guide/net/properties.html"> | |||
Java Networking Properties</a>. Notice how not all proxy settings are documented | |||
there. | |||
<li><a href="http://blogs.sun.com/roller/resources/jcc/Proxies.pdf">Proxies</a> | |||
<li><a href="http://docs.oracle.com/javase/7/docs/technotes/guides/net/properties.html"> | |||
Java Networking Properties</a>. | |||
</li> | |||
</ul> | |||
@@ -425,7 +425,7 @@ org.apache.tools.ant.Executor implementation specified here. | |||
<td>name of a supported character set (e.g. UTF-8, ISO-8859-1, US-ASCII)</td> | |||
<td>use as default character set of email messages; use as default for source-, dest- and bundleencoding | |||
in <a href="Tasks/translate.html">translate</a> <br> | |||
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> | |||
see JavaDoc of <a target="_blank" href="http://docs.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html">java.nio.charset.Charset</a> | |||
for more information about character sets (not used in Ant, but has nice docs). | |||
</td> | |||
</tr> | |||
@@ -602,8 +602,7 @@ Here is an example: | |||
failonerror="true" | |||
dir="${sub.builddir}" | |||
timeout="4000000" | |||
taskname="startAnt" | |||
> | |||
taskname="startAnt"> | |||
<classpath> | |||
<pathelement location="${ant.home}/lib/ant-launcher.jar"/> | |||
</classpath> | |||
@@ -39,7 +39,7 @@ | |||
</target> | |||
<target name="test6"> | |||
<get src="http://www.apache.org/" dest="get.tmp"/> | |||
<get src="http://www.apache.org/" dest="get.tmp" userAgent="Apache Ant/test"/> | |||
<fileset id="t6" file="get.tmp" /> | |||
<pathconvert property="t6" refid="t6" setonempty="false" /> | |||
@@ -53,6 +53,10 @@ | |||
</fail> | |||
</target> | |||
<target name="test7"> | |||
<get src="" dest="" userAgent=""/> | |||
</target> | |||
<target name="testUseTimestamp" depends="-90s,-timestamp" /> | |||
<target name="-90s"> | |||
@@ -31,6 +31,7 @@ import java.net.URLConnection; | |||
import java.util.Date; | |||
import org.apache.tools.ant.BuildException; | |||
import org.apache.tools.ant.Main; | |||
import org.apache.tools.ant.Project; | |||
import org.apache.tools.ant.Task; | |||
import org.apache.tools.ant.types.Mapper; | |||
@@ -65,6 +66,8 @@ public class Get extends Task { | |||
private static final String HTTP = "http"; | |||
private static final String HTTPS = "https"; | |||
private static final String DEFAULT_AGENT_PREFIX = "Apache Ant"; | |||
private Resources sources = new Resources(); | |||
private File destination; // required | |||
private boolean verbose = false; | |||
@@ -77,6 +80,7 @@ public class Get extends Task { | |||
private boolean skipExisting = false; | |||
private boolean httpUseCaches = true; // on by default | |||
private Mapper mapperElement = null; | |||
private String userAgent = System.getProperty("http.agent", DEFAULT_AGENT_PREFIX + "/" + Main.getAntVersion()); | |||
/** | |||
* Does the work. | |||
@@ -216,7 +220,7 @@ public class Get extends Task { | |||
GetThread getThread = new GetThread(source, dest, | |||
hasTimestamp, timestamp, progress, | |||
logLevel); | |||
logLevel, userAgent); | |||
getThread.setDaemon(true); | |||
getProject().registerThreadTask(getThread, this); | |||
getThread.start(); | |||
@@ -247,6 +251,11 @@ public class Get extends Task { | |||
* Check the attributes. | |||
*/ | |||
private void checkAttributes() { | |||
if (userAgent == null || userAgent.trim().length() == 0) { | |||
throw new BuildException("userAgent may not be null or empty"); | |||
} | |||
if (sources.size() == 0) { | |||
throw new BuildException("at least one source is required", | |||
getLocation()); | |||
@@ -411,6 +420,16 @@ public class Get extends Task { | |||
public void setHttpUseCaches(boolean httpUseCache) { | |||
this.httpUseCaches = httpUseCache; | |||
} | |||
/** | |||
* HTTP connections only - set the user-agent to be used | |||
* when communicating with remote server. if null, then | |||
* the value is considered unset and the behaviour falls | |||
* back to the default of the http API. | |||
*/ | |||
public void setUserAgent(String userAgent) { | |||
this.userAgent = userAgent; | |||
} | |||
/** | |||
* Define the mapper to map source to destination files. | |||
@@ -553,15 +572,17 @@ public class Get extends Task { | |||
private OutputStream os = null; | |||
private URLConnection connection; | |||
private int redirections = 0; | |||
private String userAgent = null; | |||
GetThread(URL source, File dest, | |||
boolean h, long t, DownloadProgress p, int l) { | |||
boolean h, long t, DownloadProgress p, int l, String userAgent) { | |||
this.source = source; | |||
this.dest = dest; | |||
hasTimestamp = h; | |||
timestamp = t; | |||
progress = p; | |||
logLevel = l; | |||
this.userAgent = userAgent; | |||
} | |||
public void run() { | |||
@@ -60,6 +60,10 @@ public class GetTest extends BuildFileTest { | |||
executeTarget("test6"); | |||
} | |||
public void test7() { | |||
expectBuildException("test7", "userAgent may not be null or empty"); | |||
} | |||
public void testUseTimestamp() { | |||
executeTarget("testUseTimestamp"); | |||
} | |||