This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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