【发布时间】:2023-04-04 09:59:01
【问题描述】:
我想在 ant 中从 maven 获取一组运行时依赖项。我正在使用 maven ant 任务。
我知道你可以通过作用域来限制依赖(see docs):
<artifact:dependencies filesetId="dependency.fileset" useScope="runtime">
<artifact:pom file="pom.xml" id="myProject" />
</artifact:dependencies>
并且范围选项(来自文档)是:
•compile - Includes scopes compile, system and provided
•runtime - Includes scopes compile and runtime
•test - Includes scopes system, provided, compile, runtime and test
但是,我想只获取运行时依赖项(即排除编译依赖项)。到目前为止我最好的想法是获取运行时依赖项和编译依赖项,并遍历运行时依赖项以找到那些不在编译依赖项中的依赖项,但我还没有弄清楚如何做到这一点。
有什么想法吗?
【问题讨论】:
标签: ant maven dependencies