【发布时间】:2018-06-01 12:30:12
【问题描述】:
在当前项目中,大多数传递工件都标记为“已提供”(由于项目架构的一些“最佳实践” - 我无法更改此行为)。但是我需要获得他们的完整列表才能使项目活跃起来。
我如何计算整个工件列表,包括提供的? 如何覆盖传递工件的“提供”范围?
好的。我的案例有一个样本:
<!-- sample of my pom is so:-->
<project>
.....
<group>rd-service</group>
<artifactId>rd-service</artifactId>
.....
<dependencies>
.....
<!--link to the problem artifact -->
<dependency>
<groupId>third-party-lib-group</groupId>
<artifactId>third-party-lib-artifact</artifactId>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
<!--problem artifact looks like so -->
<project>
.....
<group>third-party-lib-group</group>
<artifactId>third-party-lib-artifact</artifactId>
.....
<dependencies>
.....
<!--How I can calculate automatically whole dependencies
which looks like this and its transitive
dependencies too?
Author of spring-context-customized can't do it by himself. -->
<dependency>
<groupId>org.springframework.fork</groupId>
<artifactId>spring-context-customized</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
再看问题here
【问题讨论】:
-
你说“计算”是什么意思?
-
@EugeneS 我的意思是获取所有依赖项的列表,包括提供的。我需要将它们包含在项目中。
-
mvn dependency:tree将显示所有依赖项。也许这可以帮助您满足您的需求? -
如果您需要将它们包含在 EAR 中,则不提供它们。您只是在这里使用了错误的范围。您应该与“最佳实践”的作者讨论这个问题。
-
当然不是。正如我在问题中指出的那样,我也注意获取所有提供的工件。客户将所有自己的工件标记为已提供时出错,但它无法将包含所有工件的存档提供给我们。
标签: java maven dependency-management