File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 Murach's Java Servlets and JSP this week in the Servlets 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
 
Similar Threads
ant junit
Execute ant build file from a java source
executing perl scripts from java
return calculcatedValue to ant script from Java class
Stateful Bean Naming Exception