Ant isn't all that magical. It essentially is a command-line tool based on XML similar in concept to what you might have created using a make file in
java.
An EAR is identical to a JAR/ZIP file except that it has a .ear extension. If your directory structure is all ready defined such that just creating an EAR works fine, then all your ant script would have to do is a single store command which copies all the files/directories into a new ear file.
Deploying can vary. In JBoss and WebLogic for example, you can install a new EAR by copying the file into an applications folder, so ANT would just execute a copy command. In WebSphere, its not as easy since you need to integrate with the WSADMIN scripting tool. You might want to review this link for some guidance:
http://publib.boulder.ibm.com/infocenter/wasinfo/v5r1//index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/javadoc/ae/com/ibm/websphere/ant/tasks/InstallApplication.html The real power of ANT is dynamic variable naming. So rarely in an ANT script to you put the hardcoded path or application name, most of the time you define everything in terms of variables and either put these at the beginning of the ANT file or define them as environment variables.