gpt4 book ai didi

maven-2 - maven 条件依赖

转载 作者:行者123 更新时间:2023-12-04 05:21:44 26 4
gpt4 key购买 nike

我们希望根据客户的选择捆绑来自(Alfresco 或 Jackrabbit 或 ...)的库依赖项。依赖项的数量实际上因所选供应商而异。我们如何在 maven 级别提供 Hook ,以便最终产品仅包含根据客户选择的依赖 jar。

最佳答案

您可以通过将所需的依赖项放入特定于供应商的 profiles 来实现此目的。在你的 pom 中:

<profiles>
<profile>
<id>Alfresco</id>
<dependencies>
...
</dependencies>
</profile>
<profile>
<id>Jackrabbit</id>
<dependencies>
...
</dependencies>
</profile>
</profiles>

然后,您可以为您的构建激活所需的配置文件,例如:
mvn -PJackrabbit install

关于maven-2 - maven 条件依赖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2408696/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com