aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Execute Ant script with Java file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Execute Ant script with Java file" Watch "Execute Ant script with Java file" New topic
Author

Execute Ant script with Java file

Troy Archbold
Greenhorn

Joined: May 17, 2005
Posts: 15
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

Joined: Aug 31, 2004
Posts: 225
Ant ant = new Ant();
ant.setProperty("item", "blahblah");
ant.setProperty("inputdir", "blahblah");
ant.setProperty("outputdir", "blahblah");
ant.setAntfile("buildhtml.xml");
ant.execute();
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Execute Ant script with Java file