0

I want to run Ant scripts from within a Java program. For this I found Run ant from Java but it requires the build.xml to reside in the filesystem. However I'd like to run the build script either to be on the classpath (inside a jar) or maybe even come via the network.

Is it possible to make Ant process a build script coming via an InputStream?

Queeg
  • 7,748
  • 1
  • 16
  • 42
  • I could be wrong but I suspect not. A thorough search of the javadoc for Ant itself should confirm it. A workaround would be to create a temp file – g00se Mar 26 '22 at 14:51
  • http://fikin-ant-tasks.sourceforge.net/api/net/sf/fikin/ant/EmbeddedAntProject.html might be worth a look. – martin clayton Mar 26 '22 at 16:43
  • @g00se Thank you. I am aware of the workaround but wanted to take it directly to the classpath. – Queeg Mar 26 '22 at 16:56
  • @martinclayton Having checked the code it seems that EmbeddedAntProject copies the buidl script into a temporary file before executing it. Well, maybe there is no real answer to my problem... – Queeg Mar 26 '22 at 17:06

0 Answers0