Apache Ivy:如何在发布时将时间戳附加到工件

时间:2015-08-15 07:20:16

标签: publish ivy

使用常春藤:发布 ant任务发布工件时,工件名称会附加我们为常春藤:发布 revision / pubrevision 属性指定的内容>任务。

有没有办法将时间戳附加到此名称?

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

但我的发布蚂蚁任务如下:将其发布为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>

不明白为什么常春藤:发布更改工件的名称?任何帮助?

2 个答案:

答案 0 :(得分:1)

在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" />

答案 1 :(得分:0)

使用时间戳发布SNAPSHOT工件是常春藤不支持的Maven存储库功能。

在这里解释:

相关答案:

相关问题