0

我正在我的大学从事开源软件的安全项目。我正在尝试从源代码构建 freemarker,但遇到了一些问题。我可以在网上找到的所有内容都表明在根目录中简单运行“ant”应该构建项目。唯一的要求是您安装了 ant v1.7.0,我就是这样做的。

当我进入根目录并输入“ant”时,我得到以下输出:

Buildfile: build.xml

init:

_autoget-deps:

update-deps:
     [echo] Getting dependencies...
     [echo] -------------------------------------------------------

BUILD FAILED
/media/osr/runs/java/freemarker/freemarker/trunk/freemarker/build.xml:64: The following error occurred while executing this line:
/media/osr/runs/java/freemarker/freemarker/trunk/freemarker/build.xml:567: The following error occurred while executing this line:
/media/osr/runs/java/freemarker/freemarker/trunk/freemarker/build.xml:575: Problem: failed to create task or type antlib:org.apache.ivy.ant:settings
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.

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


Total time: 0 seconds
4

4 回答 4

2

build.xml 没有默认目标。试试这个

ant compile

编辑:改变目标

于 2009-07-01T04:29:03.407 回答
1

您还需要 Apache Ivy。我们已经改变了一段时间的构建过程;它现在使用 Ivy 而不是手动依赖管理。

于 2009-07-01T08:34:19.457 回答
1

在 Ubuntu/Debian 上安装 Ivy 还需要手动将其添加到 ant 类路径中。

虽然这可能不是最干净的方法 [1]

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

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=547969

于 2012-03-08T17:40:23.060 回答
0

安装常春藤后,运行

ant compile

工作得很好。

谢谢!

于 2009-07-04T03:04:27.220 回答