{"id":15649428,"url":"https://github.com/borkdude/deps-infer","last_synced_at":"2025-04-30T16:21:28.556Z","repository":{"id":42616093,"uuid":"341871039","full_name":"borkdude/deps-infer","owner":"borkdude","description":"Infer mvn deps from sources","archived":false,"fork":false,"pushed_at":"2021-10-28T09:42:09.000Z","size":40,"stargazers_count":40,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T17:46:13.541Z","etag":null,"topics":["clojure","dependencies","static-analysis"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/borkdude.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-24T11:01:11.000Z","updated_at":"2024-05-31T07:55:43.000Z","dependencies_parsed_at":"2022-09-24T05:12:16.003Z","dependency_job_id":null,"html_url":"https://github.com/borkdude/deps-infer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borkdude%2Fdeps-infer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borkdude%2Fdeps-infer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borkdude%2Fdeps-infer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/borkdude%2Fdeps-infer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/borkdude","download_url":"https://codeload.github.com/borkdude/deps-infer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251739935,"owners_count":21635949,"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":["clojure","dependencies","static-analysis"],"created_at":"2024-10-03T12:29:42.569Z","updated_at":"2025-04-30T16:21:28.537Z","avatar_url":"https://github.com/borkdude.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deps-infer\n\nInfer mvn deps from sources.\n\n## Status\n\nProof of concept, subject to change. Improvements welcome!\n\n## Use cases\n\nThis tool can be used to:\n\n- Make implicit deps explicit\n- Check which deps you are _not_ using by comparing the output with your existing `deps.edn`\n- Port a `lein` `project.clj` or `boot` `build.boot` to `deps.edn`\n- Port scripts (e.g. [babashka](https://github.com/babashka/babashka)\nscripts) to a `deps.edn` project.\n- Migrate from git deps to mvn deps\n- Check if there is a newer version available\n\n## Run\n\n``` clojure\n$ clojure -M -m deps-infer.main\n```\n\nThis will index your `.m2/repository` and will analyze your sources under `src`\nand `test`.\n\nBy default it will write the analysis output on a `.deps-infer/` inside the `--repo`\ndirectory. You can change the location using the `--cache-dir` option.\n\nAfter that it will suggest a list of dependencies that you can add to your\n`deps.edn`. It will always pick the newest version that is available in your .m2\nrepo.\n\nFor this project it will print:\n\n``` clojure\nbabashka/fs {:mvn/version \"0.0.1\"}\nclj-kondo/clj-kondo {:mvn/version \"2021.02.13\"}\norg.clojure/clojure {:mvn/version \"1.10.3-rc1\"}\norg.clojure/tools.cli {:mvn/version \"1.0.194\"}\nversion-clj/version-clj {:mvn/version \"2.0.1\"}\n```\n\nNamespaces that cannot be resolved will cause a warning to be printed:\n\n``` clojure\n$ cat corpus/non_existing.clj\n(ns non-existing\n  (:require [foo.bar :as x]))\n```\n\n```\n$ clojure -M -m deps-infer.main --analyze corpus/non_existing.clj\nWARNING: no dep found for foo.bar\n```\n\n## CLI options\n\n- `--repo`: The location of the mvn repo.\n- `--analyze`: The file, directory or directories of sources to analyze. You can\ncombine multiple files and directories using the OS-specific path separator:\n`src:test`.\n- `--snapshots`: Suggest `SNAPSHOT` versions.\n\n## Possible improvements\n\nPRs welcome.\n\n- [ ] Download an index of all of Clojars for inferencing of deps that are not\n      in your local `.m2/repository`. This index must be kept up to date,\n      e.g. daily, and be committed to some git repo where we can then fetch it.\n\n## Troubleshooting\n\nTo re-index your repo, remove the index of namespaces to jars, run:\n\n``` bash\n$ rm -rf .work/index.edn\n```\n\nand then run this tool again.\n\n## Credits\n\n- [hiredman](https://gist.github.com/hiredman/15186e238dc365fd72e2e09c3eb7561a)\nfor coming up with the idea.\n\n## License\n\nCopyright © 2021 Michiel Borkent\n\nDistributed under the EPL License. See LICENSE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborkdude%2Fdeps-infer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fborkdude%2Fdeps-infer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fborkdude%2Fdeps-infer/lists"}