This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills: The software developer's life manual and have John Sonmez on-line!
See this thread for details.
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to pass command line parameters in calling ant file

 
Ketan Parekh
Greenhorn
Posts: 20
  • 0
  • 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
Pie
Posts: 42966
73
  • 0
  • 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
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Buddy i will try it.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic