问题描述
如果我的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时,我可以说这解决了:
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"
我看到常春藤如何解析[组织],[模块]和[修订]在URL模式(duh),但它如何解决[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]?
的文档似乎缺乏。
推荐答案
Ivy首先解析< ivy pattern ... />
,其中包含组织,模块和修订,以及 [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
这是此模块的常春藤配置文件。除其他外,这个常春藤配置文件包含有关其他工件的信息,特别是:
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"/>
这两个用于完成<工件模式...... />
part - 下载许可证并下载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文件中提供的工件模式中的变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!