Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use java code parsing to determine if jars are required #6

Open
xiwenc opened this issue Mar 14, 2022 · 5 comments
Open

Use java code parsing to determine if jars are required #6

xiwenc opened this issue Mar 14, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@xiwenc
Copy link
Contributor

xiwenc commented Mar 14, 2022

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.

@xiwenc xiwenc added the enhancement New feature or request label Sep 29, 2022
@zeeshantariqrafique
Copy link

Looks good , I would like to pick this up if it is already not taken ?

@xiwenc
Copy link
Contributor Author

xiwenc commented Nov 15, 2022

Hi Zeeshan, feel free to implement this. Didnt get around to do this yet.

@xiwenc
Copy link
Contributor Author

xiwenc commented Nov 15, 2022

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?

@zeeshantariqrafique
Copy link

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.

@xiwenc
Copy link
Contributor Author

xiwenc commented Dec 17, 2022

Yes that's a great idea. Reverse generate a mvn pom.xml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants