Robin Coe
Robin Coe

Reputation: 750

What version of Ant comes with Travis-CI?

I have an ant build script that's failing in Travis, because of an Ant extension point. I can't find any documentation that describes what version of Ant is supported by Travis, but extension points came in with 1.8.0 and I expect Travis' version is newer than that? I am currently building with 1.9.4 on Windows and have used similar includes on Linux without problems. My extension point looks like:

<include file="version.xml"
         as="version"
         description="Create the VersionInfo class that is used at runtime to display version info for the build" />

<extension-point name="generate-version" depends="init" />

My version.xml file contains this extension point:

    <target name="compile"
        depends="precompile,buildinfo"
        extensionOf="generate-version">

But the Travis build reports this error:

BUILD FAILED

can't add target version.compile to extension-point version.generate-version because the extension-point is unknown.

Is there a problem using extension points in Travis-CI?

Thanks.

Upvotes: 2

Views: 790

Answers (2)

UBIK LOAD PACK
UBIK LOAD PACK

Reputation: 34536

To use the version you want of Ant, do the following (here we want 1.10.1) which works with Java 9:

 before_install:
    - wget --no-check-certificate https://www.apache.org/dist/ant/binaries/apache-ant-1.10.1-bin.tar.gz
    - tar -xzvf apache-ant-1.10.1-bin.tar.gz
    - export PATH=`pwd`/apache-ant-1.10.1/bin:$PATH
    - echo $(ant -version)

Upvotes: 3

Robin Coe
Robin Coe

Reputation: 750

by adding a pre_install hook:

before_install:
  - echo $(ant -version)

causes the build log to include the version:

Apache Ant(TM) version 1.8.2 compiled on December 3 2011

(Rhetorical) question is, why is Travis so ridiculously out-of-date and why will it not update ant by using:

sudo apt-get -qq update
sudo apt-get install ant

The version that Travis includes was compiled in 2011!

Upvotes: 1

Related Questions