I have been wrestling with this problem for a while now.
I use IDEA to build my projects for local testing. I have written some pretty neat build scripts to allow Ant to do the same thing; this is in anticipation of having a separate build machine that will retrieve sources from CVS instead of having them locally available. So now both IDEA and Ant can build and test my software.
My problem comes in when projects are dependent on libraries, or other software that I've written. If it is my own software, and I need to make a change, I have to go change the library, which requires me to shut down the current instance of IDEA in order to NOT have problems after I've built new .jar files. So if I have a project P and a library L that I have both written, I need to close P before I make changes to L so that P will read the new .jar files for L when I reload it. Apparently IDEA will not swap .jar files once they are loaded. Usually this results in not recognizing any of L's classes if I remake L's .jar file with P still loaded. Should I instead unify my entire source tree and use ANT to make the appropriate .jar files when needed?
The other problem stems from deploying P. Let's say I'm using L, trove, log4j, and BeanShell. Currently, I point IDEA to look at the individual directories for all those packages using "Global" libraries, including for my own, L. I then go to the ANT build script properties and check off "Use project classpath" so that Ant gets the same libraries that IDEA does. Now, does this mean that my Ant build script will not run correctly separate from IDEA, since it depends on the IDEA project classpath?
What I also can't figure out is, how do I get ANT to then package my application, P, along with L, trove, log4j, and BeanShell? Am I forced to maintain a new .properties file that lists each library, and is Ant forced to copy them in during the creation of the final set of .jars in my "dist" directory?
Thanks for any help.