• Post Reply Bookmark Topic Watch Topic
  • New Topic

re-packaging jars  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all!

I hope the following is not too off-topic or "false-forum-ed"...

Let's say I've some 300-400 class files packaged in one jar. These class files are from different (sub-)projects and were created/packaged from different ant build.xml's.

Now if I invoke/instantiate _one_ class file (inside an applet) it needs/depends on some other class files. But it will *never* use *all* of the included class files. Understand?
Nowadays the "global/mammouth" tar grows too big and let's say bandwidth is expensive. :-)
The question now is: How can I "re-factor" or better repackage my jar to only contain needed class files? I am aware that the classloader may load class's dynamically at runtime but let's assume the dependency shall be "runtime-static". (i.e. you may just recursivley follow all the "imports" to satisfy the classloader at runtime.)

I thought that this would have been an often arised question/claim and google'd and read FAQs but to no avail :-(
What made me a little bit worried is that there even was no ant task to do something like that...

I found a tool, "JDepend", which could build dependecy trees (to do code metrics) but found that the textual output of this tool was not apropriate for doing repackaging inside of a "new" ant task....

Anyone who has done something like this before?

TIA. Salut, J�rg
 
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might search the OO, UML, etc forum for "package dependencies". There was a spirited discussion about packaging, and one of the participants mentioned a tool that will analyze dependencies and build the minimal jar for a given program. Sorry I don't recall the name. If you can't find it by search, drop a note in that forum and see if he's still around.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!