I'm trying to invoke a jar, but I don't see any output when I run the command without args, and when I do run with args, I get the following error:
[ant:java] The args attribute is deprecated. Please use nested arg elements.
[ant:java] Java Result: 1
How do I invoke ant.java in such a way that I see output and can pass arguments?
task compressJs(){
ant.java(jar:"lib/yuicompressor-2.4.6.jar",fork:true,args:['js/file.js', '-o', 'build/js/file.js'])
}
Your args should be specified like this:
ant.java(jar:"lib/yuicompressor-2.4.6.jar",fork:true) {
arg(value: "js/file.js")
arg(value: "-o")
arg(value: "build/js/file.js")
}
Pretty much it is the same as you would do with ant except using the Groovy style markup builder instead of XML.
By default your output will go to the screen. If you want to redirect it, set the 'output' property.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With