【发布时间】:2015-08-28 23:52:53
【问题描述】:
我认为使用 maven 依赖插件命令行可以轻松下载所有依赖项,包括给定工件的传递依赖项。例如下面的两个命令可以用来下载和复制工件atmosphere-runtime的所有依赖项,只包括编译和提供的依赖项,不包括测试的依赖项,
mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:get -DgroupId=org.atmosphere -DartifactId=atmosphere-runtime -Dversion=2.3.3 -Dtype=pom
mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:copy-dependencies -f <path-to-local-repo>\org\atmosphere\atmosphere-runtime\2.3.3\atmosphere-runtime-2.3.3.pom -DoutputDirectory=<path-to-target-dir> -DincludeScope=compile
但是上面的问题是它包含了被标记为可选的依赖项。继续上面的示例,标记为“atmosphere-runtime”的可选依赖项的工件“grizzly-framework-http”连同其所有传递依赖项一起被下载/复制。
有没有办法在下载依赖项时过滤掉或排除这些标记为“(可选)”的依赖项?
【问题讨论】:
-
我报告了这个功能请求issues.apache.org/jira/browse/MDEP-661