Travis CI doesn't install Ant while using language: java

My build is failing (link), because Ant isn’t installed. My build script is rather simple:

language: java

What I’m missing? It’s probably pretty broad question. I’ve read a few wiki pages about it, and I was pretty much sure that you’ve got ant OOTB on your container.

1 Like

I’ve followed this article and left the travis file as the website was stating. It still doesn’t work, tho.

Use

addons:
  apt:
    packages:
      ant

This will get you ant 1.9.6.

To get a later version, install it manually.

ant is not preinstalled in xenial. It is preinstalled in trusty (from apt package). mvn and gradle are present in both.

The docs do mention this fact: JVM (Clojure, Groovy, Java, Scala) support - The Xenial Build Environment - Travis CI doesn’t list ant among preinstalled tools.

You can suggest a better wording for https://docs.travis-ci.com/user/languages/java/ at https://github.com/travis-ci/docs-travis-ci-com/edit/master/user/languages/java.md to make this more clear so that others don’t fall into the same trap.

2 Likes