Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

Dependency analysis

Thread view: 
groupknowledge@gmail.com - 02 Dec 2005 20:27 GMT
I needed some help in figuring out how to approach the following
problem:
I am trying to use only some parts of a huge application. I am
basically using only one class in my simple application that belongs to
the huge app. Currently, I am having to manually import this class and
then import all its dependencies and check for their dependencies and
so on until all references are resolved. This is painful and I was
wondering if it there was a simple script (ANT or otherwise) that given
a particular java class, analyzes all the packages that are required to
compile it (recursively) successfully, jars them into a single file?
Thank you,
Gknowledge
jfbriere - 02 Dec 2005 21:23 GMT
ANT task:
http://genjar.sourceforge.net/

Regards
Larry Barowski - 03 Dec 2005 02:46 GMT
>I needed some help in figuring out how to approach the following
> problem:
[quoted text clipped - 6 lines]
> a particular java class, analyzes all the packages that are required to
> compile it (recursively) successfully, jars them into a single file?

If you have the source code for the huge application, you
can let javac do the work. Just delete all the class files and
compile that one class you use.
Mike Schilling - 03 Dec 2005 15:39 GMT
>>I needed some help in figuring out how to approach the following
>> problem:
[quoted text clipped - 10 lines]
> can let javac do the work. Just delete all the class files and
> compile that one class you use.

Unless any reflection is done; then all bets are off.  This can be more
insidious than it might appear.  If, for instance, the app contains an XML
parser found using JAXP's usual search algorithm (i.e. its class is named in
a resource file), that's reflection done inside Java's built-in classes, so
grepping the app for Class.forName won't find it.
Roedy Green - 03 Dec 2005 19:17 GMT
> I am
>basically using only one class in my simple application that belongs to
>the huge app. Currently, I am having to manually import this class and
>then import all its dependencies and check for their dependencies and
>so on until all references are resolved.

see http://mindprod.com/jgloss/genjar.html

With Genjar/ANT, you have to manually add the classForName type
classes, and the getResource resources, but once you have that it will
find the rest of the dependencies.  You can specify with flexible
wildcards that select files, directories or directory trees.

Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.