• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Build failed. build.xml does not exist.

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello. I am new to ANT.
I am trying to generate code coverage report using ANT but when I try to run the following in Command Prompt

cd C:/Users/DGM(IT)/Downloads/Compressed/apache-ant-1.8.4-bin/apache-ant-1.8.4/bin/C:/Users/DGM(IT)/Downloads/Compressed/JaCoCo_KT/JaCoCo_KT/JaCoCo_Ant.xml -DdumpLocation=C:/Users/DGM(IT)/Downloads/JaCoCo_KT/JaCoCo_KT generateDump


I get the error
Buildfile: build.xml does not exist!
Build failed

I navigated to the folder that contains my build file (JaCoCo_Ant.xml) and typed 'ant' in command prompt. I get the same error.
What could be the problem and how can I solve it?

My build file is as follows:


 
Marshal
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tamasa Patra wrote:I get the error
Buildfile: build.xml does not exist!
Build failed




I navigated to the folder that contains my build file (JaCoCo_Ant.xml) and typed 'ant' in command prompt. I get the same error.



It looks to me like ant is looking for a file named "build.xml", which doesn't exist. Presumably you have to tell it at the command line what the actual name of the build file is.

I couldn't make any sense out of what you said your command was, it seems to start with "cd" which isn't right. Anyway perhaps you could review that.
 
Ranch Hand
Posts: 352
2
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
as Paul commented, ant does not find build.xml

to use a different xml filename you must use -f parameter.
In your case:

ant -f JaCoCo_Ant.xml

 
Tamasa Patra
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did run the command ant -f JaCoCo_Ant.xml

I get the error:
JaCoCo_Ant.xml:20:The element type "project" must be terminated by the matching end-tag "</project>"

But as you can see above, in my original post, I have indeed ended the project element with an end-tag, "</project>".

So what is causing this error?
 
Paul Clapham
Marshal
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I edited your original post so that your XML is in code tags. Now it's much easier to see that at line 20 you have an unmatched end-tag for a <target> element. So your XML is malformed.
 
Tamasa Patra
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:I edited your original post so that your XML is in code tags. Now it's much easier to see that at line 20 you have an unmatched end-tag for a <target> element. So your XML is malformed.




It still gives the same error.

JaCoCo_Ant.xml:20:The element type "project" must be terminated by the matching end-tag "</project>"
 
Paul Clapham
Marshal
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then I would recommend making sure your XML is not malformed again. It would be easier to do that if it were properly indented -- what you posted here was sort of randomly indented, but that can happen when you mix spaces and tabs while manually indenting.

Also make sure that the XML you are looking at is the same XML which the Ant process is complaining about. You could test that by deleting it (save a copy!), and then the Ant task should complain that it can't find the build file.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!