# Maven Dependency Tree Visualizer
[](https://badge.fury.io/py/mvn-tree-visualizer)
A simple command-line tool to visualize the dependency tree of a Maven project in a graphical and interactive format.
This tool was born out of the frustration of not being able to easily visualize the dependency tree of a Maven project. The `mvn dependency:tree` command is great, but the output can be hard to read, especially for large projects. This tool aims to solve that problem by providing a simple way to generate an interactive diagram or a structured JSON output of the dependency tree.
## Features
* **Multiple Output Formats:**
* **HTML:** Generates an interactive HTML diagram of your dependency tree using Mermaid.js.
* **JSON:** Creates a structured JSON representation of the dependency tree, perfect for scripting or integration with other tools.
* **Version Display:** Show or hide dependency versions in both HTML and JSON outputs using the `--show-versions` flag.
* **Easy to Use:** A simple command-line interface that gets the job done with minimal configuration.
* **File Merging:** Automatically finds and merges multiple `maven_dependency_file` files from different subdirectories.
* **Customizable Output:** Specify the output file name and location.
* **SVG Export:** Download the generated diagram as an SVG file directly from the HTML page.
## How to Use
1. **Generate the dependency file:**
Run the following command in your terminal at the root of your Maven project. This will generate a file named `maven_dependency_file` in each module's `target` directory.
```bash
mvn dependency:tree -DoutputFile=maven_dependency_file -DappendOutput=true
```
> You can add other options like `-Dincludes="org.example"` to filter the dependencies.
2. **Visualize the dependency tree:**
Use the `mvn-tree-visualizer` command to generate the diagram.
**For an HTML diagram:**
```bash
mvn_tree_visualizer --filename "maven_dependency_file" --output "diagram.html" --format html
```
**For a JSON output:**
```bash
mvn_tree_visualizer --filename "maven_dependency_file" --output "dependencies.json" --format json
```
**With version information displayed:**
```bash
mvn_tree_visualizer --filename "maven_dependency_file" --output "diagram.html" --show-versions
```
**JSON output with versions:**
```bash
mvn_tree_visualizer --filename "maven_dependency_file" --output "dependencies.json" --format json --show-versions
```
3. **View the output:**
* Open the generated `diagram.html` file in your web browser to view the interactive dependency tree.
* Use the `dependencies.json` file in your scripts or other tools.
## Options
* `--filename`: The name of the file containing the Maven dependency tree. Defaults to `maven_dependency_file`.
* `--output`: The name of the output file. Defaults to `diagram.html`.
* `--format`: The output format. Can be `html` or `json`. Defaults to `html`.
* `--show-versions`: Show dependency versions in the diagram. Applicable to both HTML and JSON output formats.
* `--directory`: The directory to scan for the Maven dependency file(s). Defaults to the current directory.
* `--keep-tree`: Keep the intermediate `dependency_tree.txt` file after generating the diagram. Defaults to `False`.
* `--help`: Show the help message and exit.
## Contributing
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request.
Please read our [CONTRIBUTING.md](CONTRIBUTING.md) file for more details.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
Raw data
{
"_id": null,
"home_page": null,
"name": "mvn-tree-visualizer",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.13",
"maintainer_email": null,
"keywords": "cli, command-line, dependency, graph, maven, mermaid, tool, tree, visualization",
"author": null,
"author_email": "Iraklis Konsoulas <dyka3773@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/48/b4/0fa8714ca38f9221e3f2791c0336b030e7dc86fe1f584b0452c7b88a04e1/mvn_tree_visualizer-1.2.0.tar.gz",
"platform": null,
"description": "# Maven Dependency Tree Visualizer\n\n[](https://badge.fury.io/py/mvn-tree-visualizer)\n\nA simple command-line tool to visualize the dependency tree of a Maven project in a graphical and interactive format.\n\nThis tool was born out of the frustration of not being able to easily visualize the dependency tree of a Maven project. The `mvn dependency:tree` command is great, but the output can be hard to read, especially for large projects. This tool aims to solve that problem by providing a simple way to generate an interactive diagram or a structured JSON output of the dependency tree.\n\n## Features\n\n* **Multiple Output Formats:**\n * **HTML:** Generates an interactive HTML diagram of your dependency tree using Mermaid.js.\n * **JSON:** Creates a structured JSON representation of the dependency tree, perfect for scripting or integration with other tools.\n* **Version Display:** Show or hide dependency versions in both HTML and JSON outputs using the `--show-versions` flag.\n* **Easy to Use:** A simple command-line interface that gets the job done with minimal configuration.\n* **File Merging:** Automatically finds and merges multiple `maven_dependency_file` files from different subdirectories.\n* **Customizable Output:** Specify the output file name and location.\n* **SVG Export:** Download the generated diagram as an SVG file directly from the HTML page.\n\n## How to Use\n\n1. **Generate the dependency file:**\n Run the following command in your terminal at the root of your Maven project. This will generate a file named `maven_dependency_file` in each module's `target` directory.\n\n ```bash\n mvn dependency:tree -DoutputFile=maven_dependency_file -DappendOutput=true\n ```\n > You can add other options like `-Dincludes=\"org.example\"` to filter the dependencies.\n\n2. **Visualize the dependency tree:**\n Use the `mvn-tree-visualizer` command to generate the diagram.\n\n **For an HTML diagram:**\n ```bash\n mvn_tree_visualizer --filename \"maven_dependency_file\" --output \"diagram.html\" --format html\n ```\n\n **For a JSON output:**\n ```bash\n mvn_tree_visualizer --filename \"maven_dependency_file\" --output \"dependencies.json\" --format json\n ```\n\n **With version information displayed:**\n ```bash\n mvn_tree_visualizer --filename \"maven_dependency_file\" --output \"diagram.html\" --show-versions\n ```\n\n **JSON output with versions:**\n ```bash\n mvn_tree_visualizer --filename \"maven_dependency_file\" --output \"dependencies.json\" --format json --show-versions\n ```\n\n3. **View the output:**\n * Open the generated `diagram.html` file in your web browser to view the interactive dependency tree.\n * Use the `dependencies.json` file in your scripts or other tools.\n\n## Options\n\n* `--filename`: The name of the file containing the Maven dependency tree. Defaults to `maven_dependency_file`.\n* `--output`: The name of the output file. Defaults to `diagram.html`.\n* `--format`: The output format. Can be `html` or `json`. Defaults to `html`.\n* `--show-versions`: Show dependency versions in the diagram. Applicable to both HTML and JSON output formats.\n* `--directory`: The directory to scan for the Maven dependency file(s). Defaults to the current directory.\n* `--keep-tree`: Keep the intermediate `dependency_tree.txt` file after generating the diagram. Defaults to `False`.\n* `--help`: Show the help message and exit.\n\n## Contributing\n\nContributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request.\n\nPlease read our [CONTRIBUTING.md](CONTRIBUTING.md) file for more details.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n",
"bugtrack_url": null,
"license": null,
"summary": "A simple command line tool to visualize the dependency tree of a Maven project in a graphical format.",
"version": "1.2.0",
"project_urls": {
"source": "https://github.com/dyka3773/mvn-tree-visualizer"
},
"split_keywords": [
"cli",
" command-line",
" dependency",
" graph",
" maven",
" mermaid",
" tool",
" tree",
" visualization"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "561a0c48bdd74231051cec3efa4f209413a0bf660c4e558050f84d6bba48f337",
"md5": "1441911aa09e4a7e06575e341e5fa1c6",
"sha256": "3f1e47c317cb19a44a0811dabb1bdb226f7356b4fafbd3780f97202c1c5b6955"
},
"downloads": -1,
"filename": "mvn_tree_visualizer-1.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1441911aa09e4a7e06575e341e5fa1c6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.13",
"size": 9333,
"upload_time": "2025-07-08T23:05:35",
"upload_time_iso_8601": "2025-07-08T23:05:35.691576Z",
"url": "https://files.pythonhosted.org/packages/56/1a/0c48bdd74231051cec3efa4f209413a0bf660c4e558050f84d6bba48f337/mvn_tree_visualizer-1.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "48b40fa8714ca38f9221e3f2791c0336b030e7dc86fe1f584b0452c7b88a04e1",
"md5": "9de0f1820c4d6adbd90a7d185597d858",
"sha256": "9f5d9577cc187eb86814554deed91faadd243bce4aaf7e780898cc0b60a8d484"
},
"downloads": -1,
"filename": "mvn_tree_visualizer-1.2.0.tar.gz",
"has_sig": false,
"md5_digest": "9de0f1820c4d6adbd90a7d185597d858",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.13",
"size": 32761,
"upload_time": "2025-07-08T23:05:36",
"upload_time_iso_8601": "2025-07-08T23:05:36.408201Z",
"url": "https://files.pythonhosted.org/packages/48/b4/0fa8714ca38f9221e3f2791c0336b030e7dc86fe1f584b0452c7b88a04e1/mvn_tree_visualizer-1.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-08 23:05:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dyka3773",
"github_project": "mvn-tree-visualizer",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "mvn-tree-visualizer"
}