Actually, I prefer to build ONE
unit for all environments and control the details by injecting configuration information. You can do this easily using JNDI and the Context xml configuration in
Tomcat for simple stuff, or keep more complex infomation in an external file or database and inject the location of that information.
The advantages of this are that I don't have to juggle 2 different types of builds and if something goes wrong in production, I don''t have to worry about build differences on the test system hiding the problems with the production code.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.