aspose 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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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: 30352
    
150

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