ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
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


Jan


[1] http://one-jar.sourceforge.net/
[2] http://fjep.sourceforge.net/



>-----Urspr√ľngliche Nachricht-----
>Von: Thomas L Roche [mailto:tlroche@us.ibm.com] 
>Gesendet: Donnerstag, 15. Februar 2007 00:00
>An: user@ant.apache.org
>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: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message