This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have installed the Ant in my machine. And I have set ANT_HOME=C:\apache-ant-1.5.3-1 set JAVA_HOME=C:\j2sdk1.4.1_02 set PATH=%PATH%;%ANT_HOME%/bin There is a build.xml file bundled with an application that I have downloaded over the internet. How do I run this build.xml file?
ant <yourTarget> if you have a different XML file with targets, you can use: ant -f <yourXMLFile> <yourTarget>
I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
Joined: Nov 19, 2000
Please bear with me. What is MyXMLFile? What is MyTarget? And where should I type the command "ant <MyTarget>"? The location of this build.xml is located in the NameOfTheApplication/WEB-INF/src folder. It is an application with lots of servlets, jsps, xml files, and property files in different directories.
Joined: Nov 27, 2001
Sorry for confusing you let's start from the beginning. If you located your build.xml file, open it. you usually have many targets in your file, such as:
This is only an example, notice that you can have many targets. If you can identify one target from your XML file, you can execute it by using: ant <targetName> So, I would do: C:\>ant clean this target will delete my directory report. Now, when projects grow you might want to create separate build files, just to organize things better. you can have a build.xml, scripts.xml, reports.xml, etc. if you do not specify anything (like ant clean), then ant will look for the default XML build file (build.xml). But, if you want to tell Ant to use a different file, you use the -f flag. C:\>ant -f reports.xml clean hope it helps P.S. For simplicity, open a DOS prompt and locate the directory in which your build.xml is placed. In my example, I assumed that build.xml was in my C:\ root. let us know how it goes [ September 08, 2003: Message edited by: Andres Gonzalez ]