1.将maven依赖的jar导出到一个目录中:

mvn dependency:copy-dependencies

maven项目所依赖的jar包会默认导出到targed/dependency目录中

也可以设置输出的目录,依赖级别,通常用compile级别,如下:

mvn dependency:copy-dependencies -DoutputDirectory=/yourDir  -DincludeScope=compile

 

2.查找某个jar包的依赖

mvn dependency:tree -Dverbose -Dincludes=groupId:artifactId

 

例如:查找log4j

mvn dependency:tree -Dverbose -Dincludes=org.slf4j:log4j