Skip to content

Instantly share code, notes, and snippets.

@mikybars
Last active October 8, 2019 10:26
Show Gist options
  • Select an option

  • Save mikybars/ec8fb4f5bfc1cfe1cf012e6a1fdafb19 to your computer and use it in GitHub Desktop.

Select an option

Save mikybars/ec8fb4f5bfc1cfe1cf012e6a1fdafb19 to your computer and use it in GitHub Desktop.
Show Maven dependency tree for a project. It also filters by dependency.
$ mvn dependency:tree
[INFO] Scanning for projects...
[INFO]
[INFO] --------------< com.github.mperezi:spring-boot-template >---------------
[INFO] Building demo 1.0.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:3.1.1:tree (default-cli) @ spring-boot-template ---
[INFO] com.github.mperezi:spring-boot-template:jar:1.0.0
[INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:2.1.6.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-aop:jar:2.1.6.RELEASE:compile
[INFO] | | +- org.springframework:spring-aop:jar:5.1.8.RELEASE:compile
[INFO] | | \- org.aspectj:aspectjweaver:jar:1.9.4:compile
...
# Filtering by dependency (format: groupId:artifactId:version, wildcards supported)
$ mvn dependency:tree -Dincludes="*:*jackson*"
[INFO] Scanning for projects...
[INFO]
[INFO] --------------< com.github.mperezi:spring-boot-template >---------------
[INFO] Building demo 1.0.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:3.1.1:tree (default-cli) @ spring-boot-template ---
[INFO] com.github.mperezi:spring-boot-template:jar:1.0.0
[INFO] \- org.springframework.boot:spring-boot-starter-web:jar:2.1.6.RELEASE:compile
[INFO] \- org.springframework.boot:spring-boot-starter-json:jar:2.1.6.RELEASE:compile
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.9.9:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.0:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-core:jar:2.9.9:compile
[INFO] +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.9.9:compile
[INFO] +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.9.9:compile
[INFO] \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.9.9:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.529 s
[INFO] Finished at: 2019-07-19T11:49:34+02:00
[INFO] ------------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment