Use java code parsing to determine if jars are required
High level:
-
Walk through all java files in the project
-
Create list of classes with full names. E.g. org.json.blaat.hello
-
Walk through all jars and create list of all classes with full names also
Compute the difference and identify which jars can be removed.
Looks good , I would like to pick this up if it is already not taken ?
Hi Zeeshan, feel free to implement this. Didnt get around to do this yet.
There is one catch (challenge): how to deal with transitive dependencies. Not all jars will have a direct dependency from a java file. How do we know a jar depends on another jar?
There is one catch (challenge): how to deal with transitive dependencies. Not all jars will have a direct dependency from a java file. How do we know a jar depends on another jar?
Hi Xiwen, That is a good point you make Maven or extract byte code (.class) from jar and check for class duplicity comes to mind.
Yes that's a great idea. Reverse generate a mvn pom.xml.