How to install ant & ivy?

11

1

I've installed ant... and I've installed ivy (both from synaptic), but ant can't find ivy!

When I run ant to build 'october-chess-engine' I get the following:

BUILD FAILED
/home/zeigfreid/repos/october-chess-engine/build.xml:32: Problem: failed to create task or type antlib:org.apache.ivy.ant:resolve
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
No types or tasks have been defined in this namespace yet

This appears to be an antlib declaration. 
Action: Check that the implementing library exists in one of:
        -/usr/share/ant/lib
        -/home/zeigfreid/.ant/lib
        -a directory added on the command line with the -lib argument

I'm not sure how to proceed! I checked out this question, but it didn't address my issue.

Thanks,

Ziggy

Posted 2012-07-22T19:51:14.430

Reputation: 826

Answers

10

How did you install ivy? In any case you need to put ivy.jar (from http://ant.apache.org/ivy/download.html) in any of the listed directories

  • /usr/share/ant/lib
  • ${HOME}/.ant/lib (in your case /home/zeigfreid/.ant/lib)

You can check what and is loading if you execute it with the -v option (verbose)

Matteo

Posted 2012-07-22T19:51:14.430

Reputation: 6 553

That did it, thanks! I just made a symlink in ${HOME}/.ant/lib to the ivy.jar file. – Ziggy – 2012-07-23T17:26:57.350

10

This seems to be a common issue, as I had the same problem. After installing ivy with apt-get, it didn't show up in the desired folders, but in:

[...]
/usr/share/doc/ivy
/usr/share/doc/ivy/README
/usr/share/doc/ivy/README.Debian
/usr/share/doc/ivy/changelog.Debian.gz
/usr/share/doc/ivy/changelog.gz
/usr/share/doc/ivy/copyright
/usr/share/java/ivy-2.2.0.jar
/usr/share/java/ivy.jar
[...]

(You may have to update your mlocate database with updatedb and then use locate ivy to find it.)

To solve this: create a link in the /usr/share/ant/lib/

sudo ln -s -T /usr/share/java/ivy.jar /usr/share/ant/lib/ivy.jar

Note, that /usr/share/java/ivy.jar is a link itself.

pol3waf

Posted 2012-07-22T19:51:14.430

Reputation: 101

1Thanks, this worked for me. Although I get a warning about a 'non-official version' – RobAu – 2013-05-28T07:20:57.423

1

I found very useful to let ant to install ivy, see automatically installation.

This way the only operating system dependency is ant, and there is no need to add extra configuration like ANT_OPTS or classpath.

Jose Miguel

Posted 2012-07-22T19:51:14.430

Reputation: 11