Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Execute Ant script with Java file

 
Troy Archbold
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to execute an Ant script with my Java file. I also want the option of running individual targets from within the build.xml file. Can somebody give me some hints as to how this can be done?

I am using Ant 1.6.1.
 
Andy Hahn
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ant ant = new Ant();
ant.setProperty("item", "blahblah");
ant.setProperty("inputdir", "blahblah");
ant.setProperty("outputdir", "blahblah");
ant.setAntfile("buildhtml.xml");
ant.execute();
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic