{"id":13565335,"url":"https://github.com/ferstl/depgraph-maven-plugin","last_synced_at":"2026-01-10T20:57:05.344Z","repository":{"id":13970971,"uuid":"16671564","full_name":"ferstl/depgraph-maven-plugin","owner":"ferstl","description":"A Maven plugin that generates dependency graphs in various formats (DOT, GML, PlantUML, JSON and Text)","archived":false,"fork":false,"pushed_at":"2024-04-24T16:36:22.000Z","size":3828,"stargazers_count":562,"open_issues_count":34,"forks_count":85,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-11-04T18:46:43.319Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/ferstl.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-02-09T17:47:18.000Z","updated_at":"2024-11-03T18:41:38.000Z","dependencies_parsed_at":"2024-08-01T13:22:04.978Z","dependency_job_id":"70c52374-8bb3-41ad-aada-6200b403368e","html_url":"https://github.com/ferstl/depgraph-maven-plugin","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferstl%2Fdepgraph-maven-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferstl%2Fdepgraph-maven-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferstl%2Fdepgraph-maven-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferstl%2Fdepgraph-maven-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ferstl","download_url":"https://codeload.github.com/ferstl/depgraph-maven-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247090036,"owners_count":20881904,"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":[],"created_at":"2024-08-01T13:01:44.895Z","updated_at":"2025-04-03T22:31:04.511Z","avatar_url":"https://github.com/ferstl.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"# depgraph-maven-plugin\n\n*- A Maven plugin that generates dependency graphs in various formats (DOT, GML, PlantUML, JSON and Text)*\n\n[![Build Status](https://github.com/ferstl/depgraph-maven-plugin/actions/workflows/maven.yml/badge.svg)](https://github.com/ferstl/depgraph-maven-plugin/actions/workflows/maven.yml)  [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.ferstl/depgraph-maven-plugin/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.ferstl/depgraph-maven-plugin) [![Coverage Status](https://coveralls.io/repos/github/ferstl/depgraph-maven-plugin/badge.svg?branch=master)](https://coveralls.io/github/ferstl/depgraph-maven-plugin?branch=master) [![license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\nThis Maven plugin generates dependency graphs on single modules or in an aggregated form on multimodule projects. The dependency graphs can be created in the following formats:\n\n- `.dot`\u003cbr/\u003e\n  DOT files can be visualized with [Graphviz](http://www.graphviz.org/). When [Graphviz](http://www.graphviz.org/) is installed, the generated `.dot` files can be directly rendered into all supported image formats.\n- `.gml` (Graph Markup Language)\u003cbr/\u003e\n  GML files can be visualized with the [yEd Graph Editor](https://www.yworks.com/products/yed) which allows further processing and layouting of the dependency graph.\n- `.puml` (PlantUML)\u003cbr/\u003e\n  PlantUML files can be visualized by various tools like [planttext.com](https://www.planttext.com/) or in IntelliJ with the [PlantUML Plugin](https://plugins.jetbrains.com/plugin/7017-plantuml-integration).\n- `.json`\u003cbr/\u003e\n  This format is intended for Javascript libraries to visualize the dependency graph or for further processing.\n- `.txt`\u003cbr/\u003e\n  A more powerful alternative to `mvn dependency:tree`. The text graphs are printed to the console.\n\nFor more information take a look at the [Plugin Documentation](https://ferstl.github.io/depgraph-maven-plugin/plugin-info.html), the [Release Notes](https://github.com/ferstl/depgraph-maven-plugin/releases) and the [Wiki](https://github.com/ferstl/depgraph-maven-plugin/wiki).\n\n## Getting Started\n\nThe *depgraph-maven-plugin* is available on [Maven Central](http://central.maven.org/maven2/com/github/ferstl/depgraph-maven-plugin/). So no further repository configuration is required.\n\nUnless configured otherwise, the dependency graphs will be written to the project's build directory, `target/dependency-graph.\u003cextension\u003e`.\n\n### Run in your Maven Project\n\nTo use the plugin within your project, just add it to the `\u003cbuild\u003e` section:\n\n    \u003cbuild\u003e\n      \u003cplugins\u003e\n        \u003cplugin\u003e\n          \u003cgroupId\u003ecom.github.ferstl\u003c/groupId\u003e\n          \u003cartifactId\u003edepgraph-maven-plugin\u003c/artifactId\u003e\n          \u003cversion\u003e4.0.3\u003c/version\u003e\n          \u003cconfiguration\u003e\n            ...\n          \u003c/configuration\u003e\n        \u003c/plugin\u003e\n      \u003c/plugins\u003e\n    \u003c/build\u003e\n\n### Run on the Command Line\n\nFor ad-hoc dependency analysis the plugin can be used directly on the command line. To conveniently use this plugin on the command line, it is recommended to add the groupId `com.github.ferstl` as \"plugin group\" in your Maven `settings.xml`:\n\n    \u003csettings\u003e\n      ...\n      \u003cpluginGroups\u003e\n        \u003cpluginGroup\u003ecom.github.ferstl\u003c/pluginGroup\u003e\n      \u003c/pluginGroups\u003e\n      ...\n    \u003c/settings\u003e\n\nWith this configuration, you can use the short form `depgraph:\u003cgoal\u003e` on the command line, e.g.\n\n    mvn depgraph:graph\n\nWithout defining the plugin group, you need to fully qualify the plugin on the command line, e.g.:\n\n    # Latest version\n    mvn com.github.ferstl:depgraph-maven-plugin:graph\n    \n    # Specific version\n    mvn com.github.ferstl:depgraph-maven-plugin:4.0.3:graph\n\n## Examples\n\nAll examples are based on a [multimodule project](https://github.com/ferstl/depgraph-maven-plugin/tree/master/src/test/projects/depgraph-maven-plugin-test) with the following structure:\n\n    parent\n    - module-1\n    - module-2\n    - sub-parent\n      - module-3\n\nEach of the modules contains some dependencies in different scopes.\n\n### Simple Dependency Graph\n\nA simple graph can be created by executing the [`depgraph:graph`](https://ferstl.github.io/depgraph-maven-plugin/graph-mojo.html) goal:\n\n![Simple dependency graph](src/doc/simple-graph.png)\n\nThe goal can be configured to show the versions and/or groupIds on the dependencies:\n\n**With versions (`-DshowVersions`)**\n\n![Simple dependency graph with versions](src/doc/with-versions.png)\n\n**With groupIds (`-DshowGroupIds`)**\n\n![Simple dependency graph with groupIds](src/doc/with-group-ids.png)\n\n### Duplicates and Conflicts\n\nThe [`depgraph:graph`](https://ferstl.github.io/depgraph-maven-plugin/graph-mojo.html) goal can be configured to show duplicate (`-DshowDuplicates`) and/or conflicting (`-DshowConflicts`) versions. Duplicate versions are shown as dotted black arrows. Conflicting versions are shown as dashed red arrows:\n\n![Dependency graph showing duplicates and conflicts](src/doc/duplicates-and-conflicts.png)\n\nDuplicate dependencies do occur when more than one module defines the same dependency, which is not a problem: Maven's dependency resolution will just pick one dependency and omit all the duplicates. A conflict occurs when the same dependency occurs in different versions in the reactor. In this case Maven will choose the [nearest](http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html) version and ommit the others. Occurrences of conflicting versions should be\ninvestigated and solved if possible.\n\n### Dependency Graph by `groupId`\n\nThe [`depgraph:by-groupid`](https://ferstl.github.io/depgraph-maven-plugin/by-groupid-mojo.html) goal creates a dependency graph using the `groupId` of the dependencies:\n\n![Dependency graph by groupId](src/doc/by-group-id.png)\n\nSuch graphs give a higher-level overview of a project, i.e. they show better which \"frameworks\" used by a maven project.\n\n### Aggregated Graphs\n\nThe goals [`depgraph:aggregate`](https://ferstl.github.io/depgraph-maven-plugin/aggregate-mojo.html) and [`depgraph:aggregate-by-groupid`](https://ferstl.github.io/depgraph-maven-plugin/aggregate-by-groupid-mojo.html) create aggregated dependency graphs on the root of a multimodule project. They show the **union** of all the modules' dependencies by omitting redundant edges. Here is an example of an aggregated graph, which connects the parent project and its modules with dotted black arrows (\nthe `sub-parent` and its `module-3` were excluded from the graph for clarity):\n\n![Aggregated dependency graph](src/doc/aggregated.png)\n\nThe goal [`depgraph:aggregate-by-groupid`](https://ferstl.github.io/depgraph-maven-plugin/aggregate-by-groupid-mojo.html) does the same for the group IDs of all modules and their dependencies.\n\n### Graphs from Arbitrary Artifacts\n\nThe goal [`depgraph:for-artifact`](https://ferstl.github.io/depgraph-maven-plugin/for-artifact-mojo.html) creates a dependency graph for an arbitrary artifact. This goal can be executed without a Maven project at any place:\n\n![Arbitrary Artifact](src/doc/for-artifact.png)\n\n### Reactor graph\n\nThe goal [`depgraph:reactor`](https://ferstl.github.io/depgraph-maven-plugin/reactor-mojo.html) creates a dependency graph\nfor the build reactor of a multimodule project:\n\n![Build Reactor](src/doc/reactor.png)\n\n### Styling\n\nThis Maven plugin offers you a variety of styling options for graphs in the DOT format. These options are explained in detail on the [Styling Wiki page](https://github.com/ferstl/depgraph-maven-plugin/wiki/Styling). This is an example of the aggregated graph with some custom styles:\n\n![Dependency graph with custom styles](src/doc/aggregated-styled.png)\n\nIt shows all dependencies with group ID `com.github.ferstl` with a blue background, all test dependencies with grey text and all other dependencies with grey background.\n\n### Other Graph Formats\n\n#### GML for yEd\n\nThe GML graph format (set the `graphFormat` property to `gml`) allows visualizing a dependency graph in the [yEd Graph Editor](https://www.yworks.com/products/yed).\n\n![GML dependency graph in yEd](src/doc/yed.png)\n\nSince the generated dependency graph does not store any layout information, you need to layout the graph in yEd:\n\n- Choose *Tools -\u003e Fit Node To Label* and press *OK* in the upcoming dialog\n- Choose your layout algorithm in the *Layout* menu to layout the graph\n\n#### PlantUML\n\nPlantUML graphs can be visualized with various tools, e.g. [planttext.com](https://www.planttext.com/) or the [PlantUML Integration](https://plugins.jetbrains.com/plugin/7017-plantuml-integration) for IntelliJ (requires [Graphviz](http://www.graphviz.org/) for rendering).\n\n![PlantUML dependency graph](src/doc/puml.png)\n\n#### Text\n\nText graphs are a more powerful alternative for `mvn dependency:tree`. They are printed to the console for direct investigation.\n\n```\nparent:1.0.0-SNAPSHOT:compile\n+- module-1:1.0.0-SNAPSHOT:compile\n|  +- commons-codec:1.16.0:compile\n|  \\- commons-lang3:3.14.0:compile\n+- module-2:1.0.0-SNAPSHOT:compile\n|  +- module-1:1.0.0-SNAPSHOT:compile\n|  +- guava:33.0.0-jre:compile\n|  \\- spring-core:6.1.2:compile (optional)\n\\- sub-parent:1.0.0-SNAPSHOT:compile\n   +- module-3:1.0.0-SNAPSHOT:compile\n   |  +- module-2:1.0.0-SNAPSHOT:compile\n   |  \\- querydsl-core:5.0.0:compile\n   |     \\- mysema-commons-lang:0.2.4:compile\n   \\- module-2:1.0.0-SNAPSHOT:compile\n```\n\nFor the aggregated graphs, the option `-DrepeatTransitiveDependenciesInTextGraph` will show transitive dependencies on each node. Without this option (which is the default), transitive dependencies will only be shown the first time they occur.\n\n#### JSON\n\nJSON graphs are intended for Javascript libraries or for further processing. Using this format will automatically enable the options `showGroupIds`, `showVersions`, `showTypes` and `showClassifiers`. The idea behind enabling these options is that the consumer of the JSON data should do its own filtering. This behavior can be disabled by setting `showAllAttributesForJson` to `false`.\n\n````json\n{\n  \"graphName\": \"parent\",\n  \"artifacts\": [\n    {\n      \"id\": \"com.github.ferstl:module-2:jar:compile\",\n      \"numericId\": 1,\n      \"groupId\": \"com.github.ferstl\",\n      \"artifactId\": \"module-2\",\n      \"version\": \"1.0.0-SNAPSHOT\",\n      \"optional\": false,\n      \"scopes\": [\n        \"compile\"\n      ],\n      \"types\": [\n        \"jar\"\n      ]\n    },\n    {\n      \"id\": \"com.github.ferstl:module-1:jar:compile\",\n      \"numericId\": 2,\n      \"groupId\": \"com.github.ferstl\",\n      \"artifactId\": \"module-1\",\n      \"version\": \"1.0.0-SNAPSHOT\",\n      \"optional\": false,\n      \"scopes\": [\n        \"compile\"\n      ],\n      \"types\": [\n        \"jar\"\n      ]\n    }\n  ],\n  \"dependencies\": [\n    {\n      \"from\": \"com.github.ferstl:module-2:jar:compile\",\n      \"to\": \"com.github.ferstl:module-1:jar:compile\",\n      \"numericFrom\": 0,\n      \"numericTo\": 1,\n      \"resolution\": \"INCLUDED\"\n    }\n  ]\n}\n````\n\n## FAQ\n\nQ: Help! The dependency graph of my 10-year-old 100-module enterprise project looks like a ball of wool. I can't see anything!\n\nA: Think carefully what information you want to see in your dependency graph. Do you really want to have all third-party dependencies in your graph or do you want to see only the dependencies between your own modules? Would the `groupId` graph be a better alternative?\nGenerally, you should consequently exclude dependencies that don't give you useful information. The inclusion/exclusion mechanisms in this plugin are quite powerful and easy to use. A good starting point is the exclusion of dependencies to \"utility\" libraries, such as `commons-lang`, `guava` or `my-enterprise-project-common`. Such dependencies are typically used by every single module which is (in most cases) perfectly fine. So they don't give you much useful information when they show up in the\ndependency graph.\n\n-----\n\nQ: Help! This plugin has thousands of parameters. How do I know which ones to choose?\n\nA: Don't worry, there are only less than 40 parameters and the plugin provides good defaults for most of them. Start your dependency graph without setting any parameters and see if it fits your needs. If it doesn't, start customizing it:\n\n- Use `graphFormat` to get a graph in a different format than DOT.\n- Use `includes` and/or `excludes` for filtering.\n- Use the `show*` parameters to display more information in the graph, e.g. `showGroupIds`, `showVersions`, etc.\n\nThat's basically it. If you get interested in further customizations or if you want to do a more detailed analysis of your dependencies, take a look at the other parameters.\n\n-----\n\nQ: Why can't I show duplicates and conflicts in the aggregated graph.\n\nA: This does not make sense because dependencies are resolved individually for each module in the reactor. As a result, the same dependency edge in the graph could once occur as conflict, once as duplicate and once as resolved dependency.\n\nExample:\nSuppose, we have two modules `module-1` and `module-2` in the reactor. `module-2` has a dependency to `module-1` and both modules have a dependency to the third-party library `commons-wtf`. `module-1` references version `3.0` of this library and `module-2` references version `3.1`. If we now would display conflicts in the aggregated graph, we would get these edges (amongst others):\n\n    module-1 --- 3.1 (included) ---\u003e commons-wtf  (perspective of module-1)\n    module-1 --- 3.1 (conflict) ---\u003e commons-wtf  (perspective of module-2)\n    module-2 --- 3.0 (included) ---\u003e commons-wtf  (perspective of module-2)\n\nSuch a graph is not useful whatsoever. Unless it is not possible to access all resolved dependencies within the whole reactor, we cannot show duplicates and conflicts.\n\n-----\n\nQ: How do the `includes`/`excludes` and the other filtering parameters work?\n\nA: The filtering parameters are a comma-separated list in the form of `groupId:artifactId:type:classifier`. Not all parts need to be specified and there is wildcard support.\nExamples:\n\n- All spring-web\\* dependencies: `org.springframework:spring-web*`\n- A test jar: `com.mycompany:mylib:jar:tests`\n- The same test jar, but without explicit `type` part `com.mycompany:mylib::tests`\n\nA dependency will show up in the graph when it matches the `includes` list **and** doesn't match the `excludes` list.\n\nTake also a look at the [Filtering](https://github.com/ferstl/depgraph-maven-plugin/wiki/Filtering) documentation in the Wiki.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fferstl%2Fdepgraph-maven-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fferstl%2Fdepgraph-maven-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fferstl%2Fdepgraph-maven-plugin/lists"}