Packaging applications with Ant
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I've become frustrated recently while trying to package EJB/WAR modules together in an EAR with Netbeans. I was wondering if using Ant would let me package applications without the use of an IDE??In this case, I'm trying to use local interface of a session bean but I don't know all the nuances to correctly use netbeans to set up dependancies etc between the modules....Maybe I should buy a copy of Ant in Action?
===>SCJP 1.5(72%)<===
==>SCWCD1.5(76%)<===
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Cheers, Martijn,
Twitter.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
===>SCJP 1.5(72%)<===
==>SCWCD1.5(76%)<===
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Ant can literally package applications. Not just the Java components like WARs and EARs, but actual OS install packages, like RPMs and Solaris dpkg's, which can manage the external requirements like setting up work directories, customizing database connections and so forth.
All of which is equally true for Maven, incidentally.
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Tim Holloway wrote:...but actual OS install packages, like RPMs and Solaris dpkg's
... not to mention OS X disk images :-)
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Ant's not as easy as I thought.Maybe I'll put this on hold until after I finish SCBCD.
Arg....Ant,jQuery,Liferay there's still too much to learn!
===>SCJP 1.5(72%)<===
==>SCWCD1.5(76%)<===
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I am wondering whether I should use ant in building my project. And if I use ant what should my main build file contain and could anybody tell me how in real time a project building aspect is approached. What are the first considerations before deciding on the content of the build file.
My project encompasses servlet & JSP and using tomcat 5 server.
Thanks to all of you.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
If you have to manually build a WAR file, what would you do? I talking about doing everything from the command line (well, except for editing the Java source files, you can use a text editor or IDE for that). I do hope that you have manually performed these tasks and not always relied on an IDE to do the work for you. Everyone should be forced to do things manually before being allowed near an IDE (but that is another topic entirely).
Anyway, the steps are pretty much this:
1) Compile the Java source code
2) Gather that files together than make up the WAR
3) Use the jar command to packages the files from step 2 into the WAR
You might want to consider prepending a step 0:
0) Set up your environment (i.e., identify the locations of your input and output files)
There you have the four targets that make up the build script. You will also want to add a fifth target, named 'clean', that removes the generated files. So you see, and Ant build script should reflect that setp you would have to do manually from the command line to accomplish your final goal.
I highly recommend that you spend a little time with Maven 2, even if you don't use it for building. Maven 2 has an assume directory layout that makes a lot of sense. Arranging your files in a well thought out and consistent layout and using that layout for all of your projects makes writing your Ant build scripts that much easier.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Peter Johnson wrote,
Wow, that is like asking for several years of experience of working with Ant to be summed up in a brief forum post. First, I recommend you do some reading - I highly recommend Ant in Action. I have an earlier addition of that book and I found it invaluable. Second, look at build scripts that others have done - I would offer the ones that I have for JBoss in Action, but they are a little complex for a beginner. Many open source projects use Ant build scripts (though many open osurcep rojects ar heading towards using Maven.) Finally, just play with Ant. Write lots of scripts. Between looking at other's scripts and writing your own you will develop a set of best practices that work for you. (I occasionally have the misfortune of having to look at some of my earlier build scripts, and shudder at some of the things I did in them, but hey, they worked!)
Thanks Peter for your suggestions.
It has been wonderful the way you considered my query. I will follow your advice and surely shoot back with some more queries. Hence forth I will continue with the same queries in the other post.webpage
| Tick check! Okay, I guess that was just an itch. Oh wait! Just a tiny ad: The new gardening playing cards kickstarter is now live! https://www.kickstarter.com/projects/paulwheaton/garden-cards |











