File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes passing commandline parameter to ant not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "passing commandline parameter to ant not working" Watch "passing commandline parameter to ant not working" New topic
Author

passing commandline parameter to ant not working

Padmanabh Sahasrabudhe
Ranch Hand

Joined: Mar 04, 2008
Posts: 53
I have following code to which I pass j.testcase parameter. Somehow the value I pass for j.testcase is not picked up by the target run. I pass the parameter as ant run -Dj.testcase=Test2. Any comments?

Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30050
    
149

It works on my machine. -Dj.testcase=foo with the below code outputs "foo" and "match". Maybe you have a trailing space/period in your command line? Try adding an echo before the switch like I did to troubleshoot.



[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: passing commandline parameter to ant not working
 
Similar Threads
Testing - Max's Book
Performance issues in decision blocks
<xtags:valueOF> problem
protected field
ant properties in subtask