如何常春藤:发布使用[分类]属性

问题描述:

在常春藤:出版商默认deliverivypattern为$ {} ivy.distrib.dir /【类型】S / [神器] - [修正]( - [分类])[转]

in ivy:publisher the default deliverivypattern is ${ivy.distrib.dir}/[type]s/[artifact]-[revision](-[classifier]).[ext]

我试图通过添加属性E要设置在我的ivy.xml分类下:分类=的元素

I try to set classifier in my ivy.xml under by adding attribute e:classifier="" to the element.

但[分类]不被设置?
当艾薇:发表在我的build.xml文件运行它似乎是空的,因此不包含在文件名模式

But the [classifier] does not get set? When ivy:publish runs in my build.xml file it appears to be empty and thereby not included in the file name pattern.

我想我已经想通了你的问题。

I think I've figured out your problem.

只是要清楚它的配置解析器决定了库文件名,而不是在发布任务。这里是我的例子,它采用了两个额外的属性问候作者中的神器和常春藤名样式:

Just to be clear it is the configured resolver that determines the repository filename and not the publish task. Here's my example, which utilises two extra attributes greeting and author in the artifact and ivy filename patterns:

<ivysettings>
    <property name="repo.dir" value="${ivy.basedir}/build/repo"/>
    <property name="ivy.checksums" value=""/> <!-- Suppress the generation of checksums -->

    <settings defaultResolver="internal"/>

    <resolvers>
        <filesystem name="internal">
            <ivy pattern="${repo.dir}/[module]/[author]-ivy(-[greeting])-[revision].xml" />
            <artifact pattern="${repo.dir}/[module]/[author]-[artifact]-[greeting]-[revision].[ext]" />
        </filesystem>
    </resolvers>
</ivysettings>

额外属性的值由确定的的ivy.xml 的文件:

<ivy-module version="2.0" xmlns:e="http://ant.apache.org/ivy/extra">
  <info organisation="myorg" module="hello" e:author="Mark"/>
  <publications>
    <artifact name="English" ext="txt" type="doc" e:greeting="hello"/>
    <artifact name="Irish" ext="txt" type="doc" e:greeting="dia_dhuit"/>
    <artifact name="Spanish" ext="txt" type="doc" e:greeting="Hola"/>
  </publications>
</ivy-module>

果然,当我公布这些文件的问候和作者变量的值是present:

Sure enough when I published the files the values of the greeting and author tags were present:

$ find build -type f
build/repo/hello/Mark-English-hello-1.0.txt
build/repo/hello/Mark-Irish-dia_dhuit-1.0.txt
build/repo/hello/Mark-Spanish-Hola-1.0.txt
build/repo/hello/Mark-ivy-1.0.xml