Hi, >I now understand how ant can help me deploy for different targets, but >how do I develop code and test it(without producing all the notification >emails, updates to the database, etc) in my development-server and then >"turn this debug code off" in the production-server when it's deployed?
There are several approaches, but the principles tend to be similar: Have complete separate dev, test, and production servers. Dev is local to each developer, quick/small, unstable. Test is as similar to production as possible in configuration and capacity, and used for integration testing, performance testing, QA. Production is production ;) Anything that's environment-sensitive goes in a configuration file, never hard-coded. Ant's filter/token mechanism is great for substituting environment-specific entries when you're creating a WAR of your app and/or deploying to dev/test/production. See the <filter> ant task reference. For logging, use a real toolkit like log4j instead of System.out or ServletContext#log. Then you can control the logging levels easily at runtime or packaging/deployment time, whatever you feel like. If you configure logging from a file, you can use Ant filter tokens again in this file. Updates to the database are part of testing: the advice about separate Tomcat instances for dev/test/production applies to databases as well. You're good about portability, right? If so, you can use a tiny and free MySQL or HSQL DB in development. Yoav This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
