如果我的 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 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 模式中的 [organization]、[module] 和 [revision](废话),但它如何解析 [artifact] 和 [ext]?
The 有关 URL 解析器的文档 http://ant.apache.org/ivy/history/trunk/resolver/url.html似乎有所欠缺。
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 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 文件。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)