[转]列出所有的Maven依赖

转发一个脚本,以列表形式显示maven中的依赖。
原文: List all your Maven dependencies

1
2
3
4
5
6
7
8
9
10
# first grab all dependencies
mvn dependency:resolve
# then list them with -o to keep noise low,
# remove extra information and duplicates
mvn -o dependency:list \
| grep ":.*:.*:.*" \
| cut -d] -f2- \
| sed 's/:[a-z]*$//g' \
| sort -u

输出结果如下所示:

1
2
3
4
5
6
7
asm:asm:jar:1.5.3
asm:asm:jar:3.1
biz.aQute:bnd:jar:0.0.169
cglib:cglib:jar:2.1_3
classworlds:classworlds:jar:1.1
classworlds:classworlds:jar:1.1-alpha-2
...