本文介绍了常春藤分类器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下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>

在我的build.xml中,我想找回我正在进行的战争的所有罐子:

In my build.xml, I want to retrieve all of my jars for the war I'm building:

  <ivy:retrieve 
     pattern="${lib.dir}/[artifact]-[classifier]-[revision].[ext]"
     conf="runtime"/>

不,这行不通... fubar-1.3.jar中没有分类器.它将下载为fubar--1.3.jar

No, that won't work... There's no classifier in fubar-1.3.jar. It will download as fubar--1.3.jar

  <ivy:retrieve 
     pattern="${lib.dir}/[artifact]-[revision].[ext]"
     conf="runtime"/>

那也不好. barfu-ID_10T-1.4.jar将以barfu-1.4.jar下载.

That's no good either. barfu-ID_10T-1.4.jar will download as barfu-1.4.jar.

我希望战争中的罐子包含在barfu-ID_10T-1.4.jar和fubar-1.3-jar中.有简单方法吗?我知道我可以创建两个不同的配置,但这太过分了.我宁愿只用 miss-named 这个罐子,因为它确实不会影响战争本身.

I would like the jars in my war to be included as barfu-ID_10T-1.4.jar and fubar-1.3-jar`. Is there an easy way of doing that? I know I could create two different configurations, but that is overkill. I'd rather just have the jars miss-named since it really doesn't affect the war itself.

推荐答案

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

Use parentheses to specify optional components of an attribute pattern:

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

这篇关于常春藤分类器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 03:50