Errata

Ant: The Definitive Guide

Errata for Ant: The Definitive Guide

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page 8
Table 1-2

There are two errors in Table 1-2 (The target element's attributes):

First, the description of the "if" attribute states: "Name of a property needed to run this task". It should be as follows: "Name of a property needed to run this target".

Second, the description of the "unless" attribute states: "Name of a property that can not be set before running this task". It should be as follows: "Name of a property that can not be set before running this target".

Anonymous  Sep 15, 2008 
Printed Page 25
clean target in first code example

<delete file="*.class"/> and <delete file="*.jar/> doesn't work. It appears that patterns are not accepted, delete file expects one file. If I replace *.class with Project.class and *.jar with Project.jar, then the clean task works.

I'm running: Apache Ant version 1.8.1 compiled on April 30 2010

Same problem with: Apache Ant version 1.5.2-23 compiled on November 12 2003

Paul Pearson  Jul 07, 2010 
Printed Page 33
Top paragraph

the book says: ". . . if one or more of the criteria evaluate to false, the property is assigned a false value."

Actually, however, if the condition holds true, the property value is set to true by default; otherwise, the property is not set.

Although an unset property may evaluate to false, if you echo the property it will not print as false, since it is unset.

Sean Wood  Apr 16, 2009 
Printed Page 34
top and bottom

The uptodate condition says that the functionality is identical to the Uptodate task. In particular it says that one of the required attributes is "property."

The available condition says that it is identical to the Available task, which requires a property attribute.

However, for both the available and uptodate conditions, the property and value attributes are redundant and will be ignored.

Sean Wood  Apr 16, 2009 
Printed Page 35
Paragraph following the Performing Conditional Actions title

Sentence:
Three elements support if and unless attributes: target, patternset (which can group
file-matching patterns such as "*.java," "*.class" and so on; see the section
"Working with Patterns"); fail target is the simplest, as shown here:

Example:
<target name="buildModule" if="code.compiled.OK"/>
.
.
.
</target>

Error 1:
The example demonstrates the if condition, not fail as stated.

Error 2:
The opening <target> element is invalid. It should not end in />. The forward slash
prior to the greater then sign negates the need for the closing </target>.

Anonymous   
Printed Page 35
1st paragraph under "Perfroming Conditional Actions"

Current version of sentence: Three elements support if and unless attributes: target, patternset (which can group file-matching patterns such as "*.java," "*.class," and so on; see the section "Working with Patterns"); fail target is the simplest, as shown here:

the last part should be:

"Working with Patterns") and fail. target is the simplest . . .

Paul Pearson  Jul 07, 2010 
Printed Page 36
Example following the title Stopping Builds

The target element in the following example is in an invalid state.

Example:
<target name=
<condition property="classes.available">

Anonymous   
Printed Page 38
6th paragraph

It says "using the srcfile attribute", but we get shown a nested srcfile element, although we got told
before, we might also use nested srcfiles elements.

You see: attribute vs. element, srcfile vs. srcfiles.

Assuming that an attribute may always get replaced by a homonymous nested element, this is still a little
misleading resp. at least confusing for the beginnner.

Anonymous   
50
Top of page

Chapter 5, definition of class Project -- included a constructor with a String argument. This should be a no-argument constructor. As displayed -- it will cause JUnit to fail (at least Junit 3.8.1).

I don't know the exact page, so just put in page 50. I am looking at it online without page numbers.

In book:

public Project (String name)
{
}

But should be

public Project ()
{
}

Jay Pedersen  May 19, 2009 
Printed Page 52
most of page, several examples

Code sample shows a <filter set> element, but "filter set" is an illegal XML name (ref: XML in a Nutshell
3rd ed. p.19). I believe the correct name is <filterset>.

Anonymous   
PDF Page 52
Code samples

The ${TODAY} variable is used as an example substitution value for a string of text matching a given pattern. However, the ${TODAY} variable is not by default defined in an Ant script; one has to first include "<tstamp/>" in the Ant script, which is a task that sets standard time properties, one of which is ${TODAY}. See https://ant.apache.org/manual/Tasks/tstamp.html for more information.

Bryce Thomas  Apr 13, 2015 
Printed Page 63
In the "tip" section with the animal footprint icon

Specify "1.5" to the javac attribute of javac...

should read

Specify "1.5" to the target attribute of javac...

OR should read

Specify "javac1.5" to the compiler attribute of javac...

I am unsure of the author's meaning here.

famethius  Mar 19, 2010 
Printed Page 82
Tip block

"Use the jarsign task..."
should read:
"Use the signjar task..."

Anonymous   
Printed Page 97
example for <checksum

checksum attribute name is lowercase.
property in <checksum example is camelCase.

Anonymous   
Printed Page 103
3rd paragraph

<filter set> and </filter set> should be <filterset> and </filterset> respectively

Anonymous  Apr 04, 2011 
Printed Page 185
Chapter 8

Hi,
in the examples of chapter 8, for every project there is only the build.xml code, not the other source code.
Can not run the command "ant" in this way : for example try to launch the command ant on chapter 8 , project war, it say the login.xml doesn't exist.



Paolo Lordi  Feb 01, 2019