Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

How To Run build.xml?

 
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ant <yourTarget>
if you have a different XML file with targets, you can use:
ant -f <yourXMLFile> <yourTarget>
 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Remember to always leap before you look. But always take the time to smell the tiny ads:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic