gpt4 book ai didi

ant - Ivy :publish use the [classifier] attribute 怎么样

转载 作者:行者123 更新时间:2023-12-04 11:17:17 25 4
gpt4 key购买 nike

在 ivy:publisher 中,默认的交付模式是 ${ivy.distrib.dir}/[type]s/[artifact]-[revision](-[classifier]).[ext]

我尝试通过向元素添加属性 e:classifier=""在我的 ivy.xml 下设置分类器。

但是 [classifier] 没有设置?
当 ivy:publish 在我的 build.xml 文件中运行时,它看起来是空的,因此不包含在文件名模式中。

最佳答案

我想我已经找到了你的问题。

需要明确的是,确定存储库文件名的是配置的解析器,而不是 发布 任务。这是我的示例,它使用了两个额外的属性 问候 作者 在 artifact 和 ivy 文件名模式中:

<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>

果然,当我发布文件时,greeting 和 author 标签的值就出现了:
$ 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

关于ant - Ivy :publish use the [classifier] attribute 怎么样,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2280578/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com