compile" 对比 conf="runtime->compile(*)" 额外的括号通配符有什么作用? Q2. 以下是做什么的-6ren">
gpt4 book ai didi

java - Ivy 依赖配置映射通配符

转载 作者:搜寻专家 更新时间:2023-11-01 02:50:24 24 4
gpt4 key购买 nike

在 Ivy 依赖下,

Q1.有什么区别

conf="runtime->compile"

对比

conf="runtime->compile(*)"

额外的括号通配符有什么作用?

Q2.

以下是做什么的?

conf="compile->compile(*)"

这不是周期性/ self 依赖吗?将 conf 映射回自身有什么意义?

最佳答案

括号是fallback :

since 1.3 a fallback mechanism can be used when you are not sure that the dependency will have the required conf. You can indicate to ivy that you want one configuration, but if it isn't present, use another one. The syntax for specifying this adds the fallback conf between parenthesis right after the required conf. For instance,

test->runtime(default)
means that in the test configuration of the module the
runtime
conf of the dependency is required, but if doesn't exist, it will use the
default
conf instead. If default conf doesn't exist then it will be considered as an error. Note that the * wildcard can be used as fallback conf.

对于问题 2:一个 conf 总是读成这样:

ConfFromThisFile -> ConfFromDependency

所以

compile->compile

会将依赖的compile配置映射到这个文件的compile配置。这不是循环。括号表示:如果依赖项中不存在 compile,则使用 *

参见 ivy documentation for dependencies 的配置映射部分.

关于java - Ivy 依赖配置映射通配符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12269446/

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