说明
用tstamp和manifest可以实现这个功能。
<?xml version="1.0" encoding="UTF-8"?> <project name="AntTest" default="build" basedir="."> <target name="build"> <!-- create timestamp with tstamp --> <tstamp> <format property="touch.time" pattern="yyyy/MM/dd hh:mm" /> </tstamp> <echo message="${touch.time}" /> <jar destfile="test.jar" basedir="./target"> <include name="**/*.*" /> <!-- set mainfest information to manifest --> <manifest> <attribute name="Implementation-Maker" value="tian.yu" /> <attribute name="Implementation-Time" value="${touch.time}" /> </manifest> </jar> </target> </project>