{"id":19153199,"url":"https://github.com/tcurdt/jdependency","last_synced_at":"2025-04-05T05:06:20.988Z","repository":{"id":437993,"uuid":"59723","full_name":"tcurdt/jdependency","owner":"tcurdt","description":"Provides an API to analyse and modify class dependencies. It provides the core to the maven shade plugin for removing unused classes.","archived":false,"fork":false,"pushed_at":"2024-04-13T12:10:17.000Z","size":6035,"stargazers_count":57,"open_issues_count":0,"forks_count":24,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-04-14T01:51:37.477Z","etag":null,"topics":["dependencies","dependency-analysis","jarjar","java","proguard"],"latest_commit_sha":null,"homepage":"http://github.com/tcurdt/jdependency","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tcurdt.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2008-10-05T12:38:39.000Z","updated_at":"2024-04-15T05:45:39.137Z","dependencies_parsed_at":"2024-01-22T13:02:48.937Z","dependency_job_id":"76d38f9c-8b37-4f11-8b45-4cf80a78a541","html_url":"https://github.com/tcurdt/jdependency","commit_stats":{"total_commits":495,"total_committers":19,"mean_commits":26.05263157894737,"dds":0.5898989898989899,"last_synced_commit":"61730c9f12db2eaeaba325aff0acd54da1c8f773"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcurdt%2Fjdependency","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcurdt%2Fjdependency/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcurdt%2Fjdependency/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcurdt%2Fjdependency/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tcurdt","download_url":"https://codeload.github.com/tcurdt/jdependency/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247289426,"owners_count":20914464,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dependencies","dependency-analysis","jarjar","java","proguard"],"created_at":"2024-11-09T08:21:30.231Z","updated_at":"2025-04-05T05:06:20.967Z","avatar_url":"https://github.com/tcurdt.png","language":"Java","readme":"[![Build Status](https://img.shields.io/github/actions/workflow/status/tcurdt/jdependency/ci.yml?style=for-the-badge)](https://github.com/tcurdt/jdependency/actions)\n[![Coverage Status](https://img.shields.io/codecov/c/github/tcurdt/jdependency/master?style=for-the-badge)](https://codecov.io/gh/tcurdt/jdependency)\n[![Maven Central](https://img.shields.io/maven-central/v/org.vafer/jdependency.svg?style=for-the-badge\u0026maxAge=86400)](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.vafer%22%20AND%20a%3A%22jdependency%22)\n[![Join the chat](https://img.shields.io/gitter/room/tcurdt/jdependency?style=for-the-badge)](https://gitter.im/tcurdt/jdependency?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n\n# jdependency - explore your classpath\n\njdependency is small library that helps you analyze class level dependencies,\nclashes and missing classes.\n\nCheck the documentation on how to use it with [javadocs](https://tcurdt.github.io/jdependency/apidocs/) and a source\n[xref](http://tcurdt.github.io/jdependency/xref/) is also available.\n\n## Where to get it\n\nThe jars are available on [maven central](https://repo1.maven.org/maven2/org/vafer/jdependency/).\nThe source releases you can get in the [download section](https://github.com/tcurdt/jdependency/downloads).\n\nIf feel adventures or want to help out feel free to get the latest code\n[via git](https://github.com/tcurdt/jdependency/tree/master).\n\n```sh\ngit clone git://github.com/tcurdt/jdependency.git\n```\n\n## How to use it\n\n```java\nfinal File jar1 = ...\nfinal File jar2 = ...\n```\n\nor\n\n```java\nfinal Path jar1 = ...\nfinal Path jar2 = ...\n```\n\n### finding classpath clashes\n\n```java\nfinal Clazzpath cp = new Clazzpath();\ncp.addClazzpathUnit(jar1, \"jar1.jar\");\ncp.addClazzpathUnit(jar2, \"jar2.jar\");\n\nfinal Set\u003cClazz\u003e clashed = cp.getClashedClazzes();\nfor(Clazz clazz : clashed) {\n  System.out.println(\"class \" + clazz + \" is contained in \" + clazz.getClasspathUnits());\n}\n```\n\n### finding different class versions\n\n```java\nfinal Clazzpath cp = new Clazzpath(true);\ncp.addClazzpathUnit(jar1, \"jar1.jar\");\ncp.addClazzpathUnit(jar2, \"jar2.jar\");\n\nfinal Set\u003cClazz\u003e clashed = cp.getClashedClazzes();\n\nfinal Set\u003cClazz\u003e uniq = clashed.stream()\n  .filter(c -\u003e c.getVersions().size() == 1)\n  .collect(Collectors.toSet());\n\nclashed.removeAll(uniq);\n\nfor(Clazz clazz : clashed) {\n  System.out.println(\"class \" + clazz + \" differs accross \" + clazz.getClasspathUnits());\n}\n```\n\n### finding missing classes\n\n```java\nfinal Clazzpath cp = new Clazzpath();\ncp.addClazzpathUnit(jar1, \"jar1.jar\");\n\nfinal Set\u003cClazz\u003e missing = cp.getMissingClazzes();\nfor(Clazz clazz : missing) {\n  System.out.println(\"class \" + clazz + \" is missing\");\n}\n```\n\n### finding unused classes\n\n```java\nfinal Clazzpath cp = new Clazzpath();\nfinal ClazzpathUnit artifact = cp.addClazzpathUnit(jar1, \"artifact.jar\");\ncp.addClazzpathUnit(jar2, \"dependency.jar\");\n\nfinal Set\u003cClazz\u003e removable = cp.getClazzes();\nremovable.removeAll(artifact.getClazzes());\nremovable.removeAll(artifact.getTransitiveDependencies());\n\nfor(Clazz clazz : removable) {\n  System.out.println(\"class \" + clazz + \" is not required\");\n}\n```\n\n## Related projects\n\n\nprovides a report of the dependencies used/unused and provides a debloated version of the pom.xml\n\n\n| Project | Description |\n|---|---|\n| [maven-shade-plugin](https://maven.apache.org/plugins/maven-shade-plugin/) | allows to inline and optimize dependencies into a single jar |\n| [gradle-lean](https://github.com/cuzfrog/gradle-lean) | gradle version of the maven-shade plugin (stale) |\n| [shadow](https://github.com/GradleUp/shadow) | gradle version of the maven-shade plugin |\n| [jarjar](http://code.google.com/p/jarjar/) | allows to inline and optimize dependencies into a single jar (stale) |\n| [proguard](https://github.com/Guardsquare/proguard) | obfuscator, shrinker (GPL) |\n| [DepClean](https://github.com/castor-software/depclean) |  provides a report of the dependencies used/unused and provides a debloated version of the pom.xml|\n\n\n## License\n\nAll code and data is released under the Apache License 2.0.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftcurdt%2Fjdependency","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftcurdt%2Fjdependency","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftcurdt%2Fjdependency/lists"}