Can a build file be executed from a JAR?

H

hust6

If I have a build file sitting in a jar, is there a way to execute an
ant script from within that build file? If so, how?

Thanks, as always, for the help.

hust6
 
R

Roedy Green

If I have a build file sitting in a jar, is there a way to execute an
ant script from within that build file? If so, how?

There are two basic approaches.


1. Extract the script from the jar with winzip or the like and feed it
to ant normally.

2. fire up ant from Java. Your java program fishes the script out of
the jar using the java.util.zip.ZipEntry and java.util.zip.ZipFile
and feeds it to ant.

The advantage of the first is you can do it in two lines.

The advantage of the second approach is you never have to touch a
platform-specific script language.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top