[m2] invoking java -jar

2005-10-03 Thread Ashley Williams
I'm writing a plugin that needs to call java -jar in the execute method. Is there an api I should use as I don't wish to use the java Runtime class to do this. I've had a look at the compiler plugin thinking that it might give me a clue (maybe by invoking javac), but it just delegates to so

Re: [m2] invoking java -jar

2005-10-03 Thread Ashley Williams
Just to give a little more context I'm writing a plugin that simply invokes "java -jar jaxb-xjc.jar ", hopefully specifying which java vm to use, eg Java 5 or Java 4. Just a simple one liner plugin really. On 3 Oct 2005, at 23:26, Ashley Williams wrote: I'm writing a plugin that needs to c

Re: [m2] invoking java -jar

2005-10-03 Thread John Casey
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 You might give commons-exec a spin... - -john Ashley Williams wrote: | I'm writing a plugin that needs to call java -jar in the execute | method. Is there an api I should use as I don't wish to use the java | Runtime class to do this. I've had a loo

Re: [m2] invoking java -jar

2005-10-03 Thread Orjan Austvold
Hi, The jar tool is located in the tools.jar archive. Try something like sun.tools.jar.Main jarTool = new sun.tools.jar.Main(System.out, System.err, "jar"); jarTool.run(new String[]{"cfm", "new-archive.jar", "myManifest.mf"}); Ørjan Ashley Williams wrote: Just to give a little more context

Re: [m2] invoking java -jar

2005-10-04 Thread Wendell Beckwith
Another thing to do especially since some devs keep steering people to use commons-exec and then other devs say not to use it is to use the command line execution functionality in plexus-utils. 1. Add the following dependency to your pom: plexus

Re: [m2] invoking java -jar

2005-10-04 Thread Ashley Williams
Thanks for the suggestions guys. Don't really want to bring in the might of plexus/commons libraries if I can help it for this one liner so what I'm doing is just calling Main directly - don't know why I didn't think of it before: com.sun.tools.xjc.Driver.main(args); I'm way of