I have a utility for linking Java files prior to deployment, which I have 
wrapped in an Ant task.

The utility does the following:

   take listing of class/source files which implement the functionality you 
want to deploy.
   locate class files
   parse bytecodes according to rules on 
http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html - 
build list of classes upon which source depends
   repeat 2-3 for newly found classes until all references are resolved

Optionally, the listed class-files can be copied to a deployment directory, for 
jar-ing up.

It is also possible to provide lists of classes to ignore (e.g. the Java 
runtime classes / contents of other jars that are distributed separately).


I have used this utility for some time, and think it offers these benefits:

   can use library classes without having to deploy the entire library or 
manually work out what dependencies there are within it.
   don't need to organise applications into specific projects, can instead 
assemble lists of classes which provide required functionality, and leave the 
resolver to include the 'glue' that these classes depend on.
   No more ClassNotFoundExceptions


I had a look before putting this together, and besides the Jikes +M +DR 
options, could not find a similar utility  (I use Javac so can't take advantage 
of the Jikes features).

I would appreciate any comments - and let me know if such a utility might be 
considered for an Ant task, or if you want the source

Nathaniel Spurling


--

This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error) please 
notify the sender immediately and destroy this e-mail. Any unauthorised 
copying, disclosure or distribution of the material in this e-mail is strictly 
forbidden.

Reply via email to