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

How to configure in Ant?

 
Jano Balakrishnan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to configure a batch file in Ant build.xml.I tried with
<target name="test">
<exec dir="." executable="cmd" spawn="true">
<arg line="/c start activemq.bat"/>
</exec>
</target>
<target name="default">
<antcall target="test" />
</target>
I am quite new to ant and really dont know what i am doing is correct.I am geting an error as Execute failed: java.io.IOException: java.io.IOException: cmd: not found
Please help me to solve this.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What version of ANT and Windows are you running on?
 
Jano Balakrishnan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Apache Ant 1.6.5 and Ubuntu(Linux)box.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, if you look at your ANT script it looks like it's trying to execute a '.bat' file (which is typically a windows batch file) using 'cmd' (which is the windows shell). You want to execute the Linux equivalents instead.
 
Jano Balakrishnan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are correct.It is a mobile Application running on windows.I am asked to write a Ant build.xml file.But my machine is linux.Now i understood that why i get this error.Also is it possible to configure and run Apache ActiveMQ from ant?
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure if there is a an ANT task for that (I'd check the ANT documentation and especially the optional libraries documentation) but I'm pretty sure that you can have if/else cases in ANT depending on OS detection, so you could run a .sh style shell script in Linux and a .bat style batch script in windows (e.g. Depending on what OS you are running your ANT build from).

Hope that helps!
 
Jano Balakrishnan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually my requirement is :
1. Setup ANT build
2. ANT deploy to install ActiveMQ
3. ANT deploy to install the Hub and the web based testing app including the database
4. README and installation document

Can you help me to do this.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jano Balakrishnan:
Actually my requirement is :
1. Setup ANT build
2. ANT deploy to install ActiveMQ
3. ANT deploy to install the Hub and the web based testing app including the database
4. README and installation document

Can you help me to do this.


I can point you in the right direction...

1. Setup ANT build - You've already got this I think. Important question for you though is where you are running this ANT build from. If you are running the build on a different machine to what is being deployed to then you will run across Windows vs Linux problems like you had before.

2. ANT deploy to install ActiveMQ - As per my previous post, there might be some ANT tasks to perform this (see you ANT documentation, especially around optional tasks). I'm not sure there would actually bea task to _install_ active MQ, configure it maybe.

3. ANT deploy to install the Hub and the web based testing app including the database - See above, look for ANT tasks that can help you, otherwise use shell scripts to perform the work and get ANT to call those shell scripts (some of the tasks you mention above sound complex and I doubt there are ANT tasks for all of them.)

4. README and installation document - That's easy, once you've written the docs there is a copy task in ANT to move that to where you need.

Hope that helps!
 
Jano Balakrishnan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot.Can you provide me the link for ant documentation?
 
Jan Cumps
Bartender
Posts: 2586
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jano Balakrishnan:
Thanks a lot.Can you provide me the link for ant documentation?
http://ant.apache.org/manual/
 
Jano Balakrishnan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can any body suggest how to automate ant deploy?
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by automate? As in run nightly? In that case you want to look at a cron job / scheduled job or (maybe) a continuous integration tool such a Cruise Control
 
Jano Balakrishnan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I set up ant build.On deploy of ant i need to install hub and ActiveMQ.Is this possible.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I stated previously:

"3. ANT deploy to install the Hub and the web based testing app including the database - See above, look for ANT tasks that can help you, otherwise use shell scripts to perform the work and get ANT to call those shell scripts (some of the tasks you mention above sound complex and I doubt there are ANT tasks for all of them.)"

Have you taken a look for ANT tasks?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic