You should have a look at One-Jar [1] or FatJar [2] for creating an "complete, startable jar".
But in your use case I would think about this: - <ssh> on the other machine - mount a directory from your developer machine with all libraries - run the tests - unmount Jan [1] http://one-jar.sourceforge.net/ [2] http://fjep.sourceforge.net/ >-----Ursprüngliche Nachricht----- >Von: Thomas L Roche [mailto:[EMAIL PROTECTED] >Gesendet: Donnerstag, 15. Februar 2007 00:00 >An: [email protected] >Betreff: how to include other JARs? > >Slightly offtopic, but since it's something that OP probably run >into, and I didn't see it answered in the FAQ, I thought I'd ask: >how to include other JARs with one's own? What I mean: > >I'm automating some tests on a legacy batch-mode app that runs >remotely. Since > >* I want to touch the remote boxes as little as possible > >* this is the kind of app that bogs down one's laptop if run locally > >* the remote boxes currently have Java but not Ant or JUnit > >for now I'm creating a JAR containing the tests, deploying that JAR to >the remotes, shelling in and running with `java -jar`. But the tests >require external JARs, notably junit.jar. I'd like to just nest those >JARs in mine, e.g. like > > <copy todir="${target.lib.dir}"> > <fileset dir="${source.lib.dir}"/> > </copy> > >before running <jar>, but > >http://java.sun.com/docs/books/tutorial/deployment/jar/downman.html >> To load classes in JAR files within a JAR file into the class path, >> you must write custom code to load those classes. > >which sounds painful. So instead I'm just doing > > <unjar ...> > <fileset dir="${source.lib.dir}"> > <include name="**/*.jar"/> > </fileset> > </unjar> > >before running <jar>. I'm wondering, is there a better way? E.g. is >writing the custom classloader trivial? > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
