ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carl Joachim Berdal Haga <>
Subject Building a jar file with class dependencies
Date Mon, 22 Oct 2001 10:57:45 GMT

What is the best way to build a jar file containing both a set of
classed and their dependencies?

The only solution I have found is to rename (or clean) the class tree,
then doing javac again to build dependencies and then jar the
resulting class tree.

Better would be to run javac with a different classpath setting so the
original class tree is ignored. Then it wouldn't be necessary to
remove the classes that are originally compiled. But it seems
impossible to get javac to ignore the initial CLASSPATH settings,
whatever classpathrefs i send to it. Is this the correct behaviour?
That the classpathref only adds to the initial $CLASSPATH?

But the best would be if the jar task itself could include
dependencies. I'm thinking of implementing something like this (the
depend task seems to have covered the hard work), but maybe someone
else has done it already?


- joachim

View raw message