ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject AW: how to include other JARs?
Date Thu, 15 Feb 2007 06:55:40 GMT
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



>-----Urspr√ľngliche Nachricht-----
>Von: Thomas L Roche [] 
>Gesendet: Donnerstag, 15. Februar 2007 00:00
>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
>> 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:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message