Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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
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
Execute ant build file from a java source
ant junit
return calculcatedValue to ant script from Java class
executing perl scripts from java
Stateful Bean Naming Exception