How to pass arguments to ant.java() method in Groovy

Go To StackoverFlow.com

0

I am trying to convert an ant <java> task to groovy. I am using the following code:

def ant = new AntBuilder();
ant.java(classpath:'jar_file_path', classname:'Main', fork:'true')

I also have a list of command line arguments to be passed to the method.

  • Q1. How should I pass the command line arguments to the method in groovy?
  • Q2. Any documentation on groovy which can get me started quickly?
2012-04-05 18:19
by pankajt


4

You should be able to do:

def ant = new AntBuilder();
ant.java(classpath:'jar_file_path', classname:'Main', fork:'true') {
  arg( value: 'arg 1' )
}

As for learning Groovy, the second edition of groovy in action is available as a early access ebook

2012-04-05 19:25
by tim_yates
thank you! it work - pankajt 2012-04-06 07:26
Ads