Apache Ivy 如何解析 ivysettings.xml 文件中提供的工件模式中的变量? [英] How does Apache Ivy resolve the variables in artifact patterns provided in the ivysettings.xml file?

查看:14
本文介绍了Apache Ivy 如何解析 ivysettings.xml 文件中提供的工件模式中的变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

If my ivysettings.xml file includes:

<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文件包括:

And my ivy.xml file includes:

<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

From when I ran Ivy, I can tell that this resolves to: 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](废话),但它如何解析 [artifact] 和 [ext]?

I see how ivy resolves the [organisation], [module], and [revision] in the URL pattern (duh), but how does it resolve [artifact] and [ext]?

关于 URL 解析器的文档 似乎是缺乏.

推荐答案

Ivy 首先解析 <ivy 模式.../>,给出组织、模块和修订,然后[artifact] 硬编码为ivy",[ext] 硬编码为xml".这会产生一个 URL,在本例中:

Ivy first resolves the <ivy pattern... />, with the organization, module, and revision given, and with the [artifact] hardcoded as "ivy" and [ext] hardcoded as "xml". This yields a URL, in this case:

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

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

这是这个模块的ivy配置文件.除其他外,这个常春藤配置文件包含有关其他工件的信息,特别是:

This is the ivy configuration file for this module. Among other things, this ivy configuration file contains information about other artifacts, in particular:

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

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

These two are then used to complete the <artifact pattern... /> part - to download the license and to download the jar file.

这篇关于Apache Ivy 如何解析 ivysettings.xml 文件中提供的工件模式中的变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆