ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chuck Holzwarth <chuck_holzwa...@yahoo.com>
Subject Re: <antcall> target unable to find buildfile
Date Fri, 28 Dec 2007 16:30:29 GMT
The line after the error looks like the problem.

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

Are the ":"s and "!" valid for the path you are trying to use?



"Toomey, Kevin H (ATS, IT)" <Kevin.Toomey@thehartford.com> wrote: 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  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  (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
For additional commands, e-mail: user-help@ant.apache.org




Thank you,
Chuck Holzwarth
(804) 403-3478 (home)
(540) 335-3171 (cell)
       
---------------------------------
Never miss a thing.   Make Yahoo your homepage.
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message