Quantcast
Channel: Eureka! » Ant
Viewing all articles
Browse latest Browse all 26

Apache Ant – Get the current running Ant version in Ant script

$
0
0

I am trying to figure out which Apache Ant version is running on the Jenkins server. Starting from Apache Ant 1.7.0, you can make use of the <Antversion> task to determine the running Ant version. The following is a simple build.xml which could serve this purpose.

<project name="ant-antversion-example" default="run" basedir=".">
  <target name="run">
    <echo message="Checking ANT version ..."/>
    <antversion property="antversion"/>
    <echo message="  version: ${antversion}"/>
  </target>
</project>

 

Try it out.
apache-ant-get-runnint-ant-version
 

Done =)

Reference Apache Ant – <Antversion>


Filed under: Ant Tagged: Ant

Viewing all articles
Browse latest Browse all 26

Trending Articles