# ant-user mailing list archives

##### Site index · List index
Message view
Top
From "Toomey, Kevin H (ATS, IT)" <Kevin.Too...@thehartford.com>
Subject <antcall> target unable to find buildfile
Date Fri, 28 Dec 2007 16:02:04 GMT
I use Ant as the workhorse of a web application used across our enterprise for all manner of
software construction tasks for ~100 applications. I have a class (AntTask) which gets instantiated
for each request (build, deployment, test, etc.).  The class creates an org.apache.ant.Project,
sets it's properties and then sets the appropriate ${ant.file} which is found via the classpath using: ClassLoader cl = this.getClass().getClassLoader(); URL url = cl.getResource("myAntFile")); project.setUserProperty("ant.file", url.toExternalForm()); ProjectHelper2 ph2 = new ProjectHelper2(); ph2.parse(project, url); I also create a temporary work area and set that as the "basedir" of the Project before running "project.execute()". Everything works fine unless my${ant.file} uses the <antcall> task. Even though the
called target is in the same ant.file, I get an error:

"java.io.FileNotFoundException: C:\FactoryFloor\widgets\MyApp\IterativeBuild\jar:file:\C:\SDF_Factory\lib\sdfant.jar!\config\int\SDFAntCommon.xml"

c:\FactoryFloor\widgets\MyApp\IterativeBuild is the directory that was set as the project's
${basedir}. In looking at the source files for <antcall> (CallTarget.java) and Ant (Ant.java), things are basically working correctly. Ant.java assumes the build file is resident on the file system either in, or relative to, the project${basedir}.

Am I missing something? Is there a way around this aside from reading the \${ant.file} at startup
and then writing it to a location on the file system? That's not a huge deal to do, but I'd
rather keep everything in the *.war.

Thanks,
Kevin

*************************************************************************
This communication, including attachments, is
for the exclusive use of addressee and may contain proprietary,
confidential and/or privileged information.  If you are not the intended
recipient, any use, copying, disclosure, dissemination or distribution is
strictly prohibited.  If you are not the intended recipient, please notify
the sender immediately by return e-mail, delete this communication and
destroy all copies.
*************************************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org