ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » arguing with Ant

Post new topic  Reply to topic
 arguing with Ant « View previous topic :: View next topic » 
Author Message
mqjeff
PostPosted: Thu Jan 26, 2012 8:36 am    Post subject: arguing with Ant Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

I have recently had a fun time trying to figure out why an Ant task was not properly executing my mqsicreatebar command.

I had done something useful sounding by putting the values that would be passed to -o and -p into specific properties in a properties file (thus ensuring that I would not need to alter my script to build different projects!).

So I had something like
Code:
<exec executable="mqsicreatebar"....>
<arg value=... />
<arg value="-p" />
<arg value="${projectList}"/>
<arg value="-o"/>
<arg value="${objectList}/>


The fun part of this is that it would work as long as project list and object list were only a single value.

When Ant sees <arg value=""> and it determines that the contents of the value includes spaces, then Ant decides that it needs to pass this value wrapped in double-quotes.

So when I ended up with more than one project and more than one object, ant would be passing
Code:
mqsicreatebar ... -o "object object" -p "project project"

instead of
Code:
mqsicreatebar ... -o object object -p project project


The workaround for this is to use <arg line=""> instead of <arg value="">.

So
Code:
<exec executable="mqsicreatebar"....>
<arg value=... />
<arg value="-p" />
<arg LINE="${projectList}"/>
<arg value="-o"/>
<arg LINE="${objectList}/>


where I have put LINE in capitals for emphasis, not correctness.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Thu Jan 26, 2012 8:39 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Nice tip ! Thanks.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » arguing with Ant
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.