常春藤检索与分类器

Dav*_* W. 4 ivy

我有以下内容ivy.xml:

<ivy-module version="1.0"
    xmlns:maven="http://maven.apache.org">

    <configurations>
    ...
    </configurations>

    <dependencies>
        <dependency org="com.foo"   name="fubur"
            rev="1.3"    conf="runtime->default"/>
        <dependency org="com.snafu" name="barfu"
            rev="1.4"    conf="runtime->default">
            <artifact name="barfu" 
                maven:classifier="ID_10T" 
                type="jar" ext="jar"/>
        </dependency>
    </dependencies>
</ivy-module>
Run Code Online (Sandbox Code Playgroud)

在我build.xml,我想要为我正在建立的战争检索所有的罐子:

  <ivy:retrieve 
     pattern="${lib.dir}/[artifact]-[classifier]-[revision].[ext]"
     conf="runtime"/>
Run Code Online (Sandbox Code Playgroud)

不,那是行不通的......没有分类器fubar-1.3.jar.它将下载为fubar--1.3.jar

  <ivy:retrieve 
     pattern="${lib.dir}/[artifact]-[revision].[ext]"
     conf="runtime"/>
Run Code Online (Sandbox Code Playgroud)

这也不好.barfu-ID_10T-1.4.jar将下载为barfu-1.4.jar.

我希望战争中的罐子barfu-ID_10T-1.4.jar和fubar-1.3-jar`一样.这样做有简单的方法吗?我知道我可以创建两种不同的配置,但这太过分了.我宁愿让罐子错过名字,因为它确实不影响战争本身.

Mar*_*nor 11

使用括号指定属性模式的可选组件:

<ivy:retrieve 
     pattern="${lib.dir}/[artifact](-[classifier])-[revision].[ext]"
     conf="runtime"/>
Run Code Online (Sandbox Code Playgroud)