Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to pass command line parameters in calling ant file

 
Ketan Parekh
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All, I m using a Build file which calls another build file.

That build file is run from the command prompt by give ant -lib <path of jars it needs for executing>.

Now i m calling this file from main build file but it does not work as i m not able to set <b>-lib </b>.

Pls can anybody let me know how to set such command line parameters to call the build file in ant script.

Thanks in Advance.

Ketan.B.Parekh
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following shows how to define a classpath, and use it in invocation of the java process:
 
Purushoth Thambu
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If lib is your only problem then you can set the lib with standard -lib option while calling the new main build file. The forked/subprocess shares the caller's environment and should not be the problem. If you have additional parameter then you need to pass through properties from the caller. I am sure the child process assigns the command line parameter to a property and all you need to do is pass those properties. Take a look at the "ant" task in the below link
http://ant.apache.org/manual/CoreTasks/ant.html
 
Ketan Parekh
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Buddy i will try it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic