Search code examples
antfreemarkerdependency-managementivy

Building FreeMarker not resolving dependencies


I'm trying to build freemarker projects and failed in first steps,

I have JDK 8 and download latest IVY (2.5.0) or recommended (2.4.0) and copy to ant lib folder, ant version is 1.10.1

I execute ant clean jar ide-dependencies and got 2 UNRESOLVED DEPENDENCIES errors:

[ivy:cachepath]                 ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:cachepath]                 ::          UNRESOLVED DEPENDENCIES         ::
[ivy:cachepath]                 ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:cachepath]                 :: ant#ant;1.6.5: not found
[ivy:cachepath]                 :: avalon-logkit#avalon-logkit;2.0: not found
[ivy:cachepath]                 ::::::::::::::::::::::::::::::::::::::::::::::

You need JDK 8 (not JDK 9!), Apache Ant (tested with 1.9.6) and Ivy (tested with 2.4.0)

Should I downgrade ant to make it work?

In Ant downgrade discouraged

Older releases of Ant can be found here. We highly recommend to not use those releases but upgrade to Ant's latest release.


Solution

  • It turns out, the build of 2.3.28 and earlier has this issue that if you run the build for the very first time (so you don't yet have <freemarker-project>/.ivy directory), and you run multiple Ant tasks (jar and ide-dependencies) with the same ant call, the 2nd task will corrupt the content of the newly created <freemarker-project>/.ivy. To fix that, you have to delete <freemarker-project>/.ivy, then run ant clean jar, and then separately run ant ide-dependencies.

    Update: Fixed from 2.3.29-SNAPSHOT