aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Ant Basic Doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Ant Basic Doubt" Watch "Ant Basic Doubt" New topic
Author

Ant Basic Doubt

Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026
From a tutorial

Let's create another build file and examine some common command line options in ant. Copy the following lines into a file named "echo.xml".



Execute ant using:

* -f echo.xml to specify "echo.xml" as the build file
* goodbye to specify "goodbye" as the target rather than the default


Question:

My Ant directory is in C drive. with ant batch file in "C:\ant\bin"
As told in the tutorial I saved this xml as "echo.xml" in "C:\ant\bin" and I didn't understand this part.




Execute ant using:

* -f echo.xml to specify "echo.xml" as the build file
* goodbye to specify "goodbye" as the target rather than the default



Actually where should I include this [ -f echo.xml ]. Should I include this in the ant batch file.

One more doubt is How to store these xml files in different folders and execute the ant batch file without errors. I tried by putting a xml file in another folder and got error when executed the ant batch file as

C:\ant\bin>
Buildfile: build.xml does not exist!
Build failed

Some one please help me.


Servlet Spec 2.4/ Jsp Spec 2.0/ JSTL Spec 1.1 - JSTL Tag Documentation
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42929
    
  68

Execute ant using:

* -f echo.xml to specify "echo.xml" as the build file
* goodbye to specify "goodbye" as the target rather than the default


That refers to command line options.
The -f switch lets you specify the build file to be used; if you omit it, Ant defaults to using "build.xml" , and will complain if it doesn't exist.
The other parameter is the target to be executed. You have two, hello and goodbye. If you omit it, the default is "hello", because that is specified in the <project> element. (The Ant manual talks about all of this in detail.)
So what you might type in is as follows:
ant -f echo.xml
ant -f echo.xml goodbye

As an aside, you should not store any build files in the bin directory. Add the bin directory to your PATH, so that you can access ant from any directory.
[ July 25, 2005: Message edited by: Ulf Dittmer ]
Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026
That worked

thank u very much




 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ant Basic Doubt