aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Buildfile: build.xml does not exist! Build failed 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 "Buildfile: build.xml does not exist! Build failed" Watch "Buildfile: build.xml does not exist! Build failed" New topic
Author

Buildfile: build.xml does not exist! Build failed

preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
Hi,

I need to develop application using spring.For this i need to install ant.I have installed ant in the path c: . but when i type ant in the cmd prompt, the following error exist:

Buildfile: build.xml does not exist!
Build failed


Please assist me to solve this

Thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41506
    
  53
So where is the build.xml file? If it's not in the directory where you're executing the command, then you need to tell Ant where to find it using the "-file" switch.


Ping & DNS - my free Android networking tools app
preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
There is build.xml in many places.But if i give the command ant -find file,the following error occurs

C:\Documents and Settings\peopleTech>ant -find build.xml
Searching for build.xml ...
Could not locate a build file!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41506
    
  53
There is build.xml in many places.

You can run only one of them at any given time. So you need to pass the path to whichever one you want to run as argument to the "-file" parameter.

C:\Documents and Settings\peopleTech>ant -find build.xml

The parameter is called "-file", not "-find". This only works if the build.xml file is in the current directory. If it's in a subdirectory, then you need to specify that, for instance: "ant -file someSubDirectory/build.xml"

I think this would be a good time for you to read the extensive Ant documentation that comes with the download; look in the "docs" directory. It covers all this.
preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
Thanks.Now i can able to successfully build the file.But i tried to build the file inside eclipse and i right click on the build.xml and clicked run as Ant build file.I found the following error in the eclipse console:


Buildfile: D:\eclipse\workspace\Springdemo\war\WEB-INF\build.xml

BUILD FAILED
D:\eclipse\workspace\Springdemo\war\WEB-INF\build.xml:85: C:\Documents and Settings\peopleTech\apache-tomcat-5.5\lib not found.

Total time: 234 milliseconds

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41506
    
  53
Does that directory exist? If not, you'll need to change the build file to reflect its proper location.
preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
Sorry for the delay.I have made the tomcat installation in the path mentioned in the build.xml.Now I am getting the following error:

Buildfile: D:\eclipse\workspace\Springdemo\war\WEB-INF\build.xml

BUILD FAILED
D:\eclipse\workspace\Springdemo\war\WEB-INF\build.xml:85: taskdef class org.apache.catalina.ant.InstallTask cannot be found

Total time: 375 milliseconds



Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41506
    
  53
The error message mentions a class that can't be found. Look around in the Ant and Tomcat jar files for that class, and make sure it's in the classpath when you run Ant.
preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
Thanks.Now it is working.In build.properties I have changed the

appserver.lib=${appserver.home}/lib
to
appserver.lib=${appserver.home}/server/lib
preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
When i try to list ant via eclipse i am getting the following error:

Buildfile: D:\eclipse\workspace\Springdemo\war\WEB-INF\build.xml
usage:
[echo] springapp build file
[echo] -----------------------------------
[echo] Available targets are:
[echo] build --> Build the application
[echo] deploy --> Deploy application as directory
[echo] deploywar --> Deploy application as a WAR file
[echo] install --> Install application in Tomcat
[echo] reload --> Reload application in Tomcat
[echo] start --> Start Tomcat application
[echo] stop --> Stop Tomcat application
[echo] list --> List Tomcat applications
build:
deploy:
list:

BUILD FAILED
D:\eclipse\workspace\Springdemo\war\WEB-INF\build.xml:133: java.io.FileNotFoundException: http://localhost:8080/manager/list

Total time: 375 milliseconds

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41506
    
  53
Without knowing what the build file is trying to do at that moment, we can't guess what's going on. But the error message is rather specific - it should allow you to start investigating what's going wrong. What have you found out so far?
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2495
    
    8

You have to run the start target first. Tomcat is not running.


OCUP UML fundamental and ITIL foundation
youtube channel
racha rumbola
Greenhorn

Joined: Sep 20, 2010
Posts: 2
i have my java -version running
all the environmental variables are set correctly
ant -version command is also working
but when i enter ant command

c:\>;ant
Buildfile: build.xml does not exist!
Build failed


with this command

C:\>ant -find build.xml
Searching for build.xml ...
Could not locate a build file!


it is asking for a build.xml file
i dont see build.xml file in any of the folders in the unzipped ant-apache-1.8.1 folder
i do not have a build.xml file
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Hi Praveen and welcome top Javaranch! Can you start a new topic with your specific problem? And please TellTheDetails


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Buildfile: build.xml does not exist! Build failed