Is it possible to programmatically create an ant build file?

Is it possible to create an ant build file from java code using the ant API?

+3
source share
3 answers

No ANT api provides such a function. You will have to use one of the following solutions: manually write the build.xml file:

  • Serialization for data stream output
  • Serializing DOM + Xerces to Output Output
  • Serializing SAX + Xerces to Output Output
+3
source

If you don't need to stick with Java, the easiest way is to use groovy and groovy ant buillder (see here ). groovy is compiled into Java VM code and can be easily integrated into a Java program.

+3

.

Java ANT API.

Java Java Ant

+1

Source: https://habr.com/ru/post/1764473/


All Articles