I have an Eclipse project that makes use of Hibernate and Log4j. The project has a lib folder where all the necessary jars reside. The project's build script makes use of Hibernate Tools to generate the java files and the db scheme. Apart from that, the build script declares a classpath which consists of the lib dir. Now when running Eclipse I get NoClassDefFoundExceptions unless I explicitly configure Eclipse's Ant plugin to include the jars from the project's lib folder. For me this looks as if I include them twice: in the script and in the Ant configuration. Is that correct or do I miss something?
Well, I can't quite wrap my poor tired brain around your question, so I'll give an answer and see if you can work back from there. Sorry about that, but I'm out sick today.
Basically, Ant hasn't got any particular magic connection to Eclipse. The ant support plugin is part of the standard package (or at least the Java one, which is what most of us care about). However, this is more of an assist than a tight connection.
What that means in practical terms is that when you run Ant inside Eclipse, what you'll get should be identical to what you get running Ant on the same build.xml file when Eclipse isn't running at all. Most notably, Eclipse project classpaths don't get a free ride into Ant. You either have to define the project classpath inside the build.xml or you have to define the project classpath on the Ant setup dialog.
I recommend doing it inside the build.xml because that makes it "real" and more importantly, write-once, run-anywhere (to steal a phrase). If you define the classpath on the Ant dialog, you're achieving the same net effect as you'd get by manually setting the CLASSPATH environment variable before calling Ant. If you explicitly define the classpath in the build.xml, people don't need this kind of secret external knowledge, so they might not hunt you down and kill you when years later someone needs to recompile in the middle of the night and it won't compile.
Just for info, I wrote an XSL a while back that will take an Eclipse project file and spit out a prototype Ant script with javac steps and classpaths. I may have posted a copy of it either in this forum or in the XML forum.
Unless you've got a really long and ugly classpath setup, you're better off doing things manually, however.
Being persecuted doesn't in any way prove your righteousness or your beliefs. Many people get persecuted because they are repugnant or annoying. Or just because they can be.
What I don't understand is how they changed the earth's orbit to fit the metric calendar. Tiny ad: