gpt4 book ai didi

java - Apache Ivy 如何解析 ivysettings.xml 文件中提供的工件模式中的变量?

转载 作者:塔克拉玛干 更新时间:2023-11-01 22:59:03 26 4
gpt4 key购买 nike

如果我的 ivysettings.xml 文件包括:

<url name="com.springsource.repository.bundles.external">
<ivy pattern="http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
<artifact pattern="http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
</url>

我的 ivy.xml 文件包括:

<dependency org="org.junit"
name="com.springsource.org.junit"
rev="4.4.0" />

从我运行 Ivy 开始,我可以看出这解析为:http://repository.springsource.com/ivy/bundles/external/org.junit/com.springsource.org.junit/4.4.0/com.springsource.org.junit-sources-4.4.0.jar

所以决议是:

[organization] => "org.junit"
[module] => "com.springsource.org.junit"
[revision] => "4.4.0"
[artifact] => "com.springsource.org.junit-sources"
[ext] => "jar"

我看到 ivy 如何解析 URL 模式中的 [organisation]、[module] 和 [revision] (duh),但它如何解析 [artifact] 和 [ext]?

documentation on the URL resolver似乎缺乏。

最佳答案

Ivy 首先解析 <ivy pattern... /> , 给出了组织、模块和修订版,并带有 [artifact]硬编码为“ Ivy ”和[ext]硬编码为“xml”。这会产生一个 URL,在这种情况下:

http://repository.springsource.com/ivy/bundles/external/org.junit/com.springsource.org.junit/4.4.0/ivy-4.4.0.xml

这是该模块的 ivy 配置文件。除其他事项外,此 ivy 配置文件包含有关其他工件的信息,特别是:

<artifact name="com.springsource.org.junit-sources" type="src" ext="jar"/>
<artifact name="license" type="license" ext="txt"/>

然后使用这两个来完成 <artifact pattern... />部分 - 下载许可证和下载 jar 文件。

关于java - Apache Ivy 如何解析 ivysettings.xml 文件中提供的工件模式中的变量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/686188/

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