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

And*_*rov 3 java ant ivy dependency-management

如果我的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>
Run Code Online (Sandbox Code Playgroud)

我的ivy.xml文件包括:

<dependency org="org.junit"
            name="com.springsource.org.junit" 
            rev="4.4.0" />
Run Code Online (Sandbox Code Playgroud)

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

决议如下:

[organization] => "org.junit"
[module] => "com.springsource.org.junit"
[revision] => "4.4.0"
[artifact] => "com.springsource.org.junit-sources"
[ext] => "jar"
Run Code Online (Sandbox Code Playgroud)

我看到常春藤如何解析URL模式(duh)中的[组织],[模块]和[修订],但它如何解析[artifact]和[ext]?

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

And*_*rov 6

Ivy首先解析了<ivy pattern... />组织,模块和修订,并将[artifact]硬编码为"常春藤"并[ext]硬编码为"xml".这会产生一个URL,在这种情况下:

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

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

<artifact name="com.springsource.org.junit-sources" type="src" ext="jar"/>
<artifact name="license" type="license" ext="txt"/>
Run Code Online (Sandbox Code Playgroud)

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