ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rhino" <>
Subject Weird behaviour from import in Ant 1.6.2
Date Thu, 30 Dec 2004 23:43:01 GMT
I am getting some weird behaviour from Ant 1.6.2 in Eclipse 3.0.1.

A while ago, I created a couple of simple imported tasks to do some basic
work for me. My plan was to import these tasks into each Ant script that I
write. Initially, this worked but I've been away from Ant for a few months
and now I find that it doesn't work any more.

Basically, the problem is that Ant isn't seeing my imported scripts any
more. Whenever I edit my build.xml, I get this message: Cannot find
${ant.home}\imports\datetime.xml imported from
E:\eclipse\3.0.1\eclipse\workspace\SDAC\xml\build.xml. (A comparable message
occurs for the other imported script, sounds.xml, so I've just commented it
out and assume it is having the same problem that 'datetime.xml' is having.)
Here is the build.xml:

<?xml version="1.0" ?>

<project name="SDAC" default="buildall"

<description>Create the SDAC jars.



Import common code.


<property name="import.path" value="${ant.home}\imports"/>

<!--import file="${import.path}\sounds.xml" description="Play appropriate
sounds depending on whether build worked or failed."/-->

<import file="${import.path}\datetime.xml" description="Display date and
time that build started."/>

<target name="go">

<echoproperties prefix="ant"/>



Do the complete build.


<target name="buildall" depends="go" description="Tasks that should always
be run upon completion of the build.">

<echo message="The SDAC jars have been generated."/>



The datetime.xml file contains the following:

<?xml version="1.0" ?>
<project name="Datetime" default="datetime" basedir=".">
<description>This fragment will be imported into every Ant build
script that needs to display the time and date that the build began.

<target name="datetime" description="Display date and time that build
 <tstamp prefix="start">
  <format property="TODAY" pattern="EEEE, MMM dd, yyyy"/>
  <format property="TIME" pattern="hh:mm a"/>
 <echo message="This Ant script began executing at ${start.TIME} on


When I run my build.xml, it confirms that ant.home is
E\:\\eclipse\\3.0.1\\eclipse\\plugins\\org.apache.ant_1.6.2. I am absolutely
certain that ant.home contains an 'imports' directory and that 'imports'
contains a file called 'datetime.xml'. However, the 'datetime.xml' file is
not visible to the Ant Editor and the task within 'datetime.xml' is not
executed when I run the build.

I also have a copy of Ant 1.6.1 installed outside of Eclipse and it also has
an 'imports' directory beneath it and a 'datetime.xml' within the 'imports'
directory; when I run a build.xml from the command line outside of Eclipse,
it also fails to run the task within 'datetime.xml', presumably because Ant
doesn't see it.

What am I doing wrong??

rhino1 AT sympatico DOT ca
"There are two ways of constructing a software design. One way is to make it
so simple that there are obviously no deficiencies. And the other way is to
make it so complicated that there are no obvious deficiencies." - C.A.R.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message