gpt4 book ai didi

publish - Apache Ivy : How to have timestamp appended to artifacts while publishing

转载 作者:行者123 更新时间:2023-12-02 03:22:57 26 4
gpt4 key购买 nike

在使用 ivy:publish ant 任务发布工件时,工件名称会附加我们为 ivy:publishrevision/pubrevision 属性指定的任何内容> 任务。

有没有办法将时间戳附加到这个名字?

再详细一点...我想将我的工件(例如 test.jar)发布到版本为 DEV.SNAPSHOT 的存储库(可能是公共(public)的或共享的),但已发布的 JAR 的名称应该类似于 test-DEV.SNAPSHOT.currentTimestamp.jar

但是我的 publish ant 任务如下是将其发布为 test-DEV.SNAPSHOT.jar

<target name="publish-local" depends="jar">
<tstamp>
<format property="snapshot.timestamp" pattern="yyyyMMdd.HHmmss"/>
</tstamp>
<move file="${jar.file}" tofile="${build.dir}/${ant.project.name}-DEV.SNAPSHOT.${snapshot.timestamp}.jar"/>
<ivy:deliver deliverpattern="${build.dir}/ivy-[revision].${snapshot.timestamp}.xml" pubrevision="DEV.SNAPSHOT" status="integration"/>
<ivy:resolve/>
<ivy:publish resolver="my-local" pubrevision="DEV.SNAPSHOT" status="integration" overwrite="true" publishivy="true">
<ivy:artifacts pattern="${build.dir}/[artifact]-[revision].${snapshot.timestamp}.[ext]"/>
</ivy:publish>
</target>

不明白为什么 ivy:publish 更改工件的名称?有帮助吗?

最佳答案

在 build.xml 中

  <tstamp>
<format property="version.time" pattern="yyyy-MM-dd-HH-mm-ss" />
</tstamp>

在 ivy.xml 中

  <info organisation="com.adme" module="foo" revision="1.0-${version.time}-SNAPSHOT" />

关于publish - Apache Ivy : How to have timestamp appended to artifacts while publishing,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32022497/

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