Recommended: Sing it, brah! 5 fabulous songs for developers
JW's Top 5
Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
Page 5 of 5
<remoteCopy machine="machinename.groupserve.com" port="9090" directory="e:\deve\ant\article\deploy" filetype="text" filename="build.xml"/>
The remoteCopy task will execute the RemoteCopyTask object and in doing so, connect to the machine/port specified and copy the file over. That task includes properties identifying
the server/port of the RemoteAntServer. Also, please note that the three file-related properties correspond with the accessor methods contained in the RemoteCopyTask object. Those values are converted into calls to those methods.
The remoteAnt task has been defined by using a similar taskdef object:
<taskdef name="remoteAnt" classname="local.RemoteAntTask"/>
The following task will execute the ant command on the remote machine:
<remoteAnt machine="machinename.groupserve.com" port="9090" />
Again, note that several command line tags are given when the server starts to set up the Ant task.
To run the example, please perform the following steps:
If you've performed the above steps, you should notice that the jar file and build file have been transferred to the remote machine and that the Ant task has been performed on the remote machine.
So, you've read through all of this. What have you learned?
The biggest takeaway from this article should be the importance of a build process to construct your environment in an effective and efficient manner. With that understanding, it is less important that you use Ant or some other homegrown scripting mechanism. However, I feel that Ant is an easy-to-learn platform-independent tool that provides expansion as needed. The XML involved in the buildfile is easy to read and understand, and a large number of already supported commands perform the vast majority of your build tasks without expansion. If you find a limitation, you can expand Ant to include your modifications.
Please review the Ant user guide found in Resources below to expand your understanding of the predefined tasks included with Ant. I hope I have given you a starting point for your future investigation of Ant and have inspired you to incorporate this tool into your development process.
Read more about Enterprise Java in JavaWorld's Enterprise Java section.