0

我使用 Netbeans 7.0 开发了一个 Web 应用程序。构建(生成战争文件)在 netbeans 中工作,但如果我使用在另一台服务器(linux)上构建项目,ant我会得到以下信息:

[packwolf src]$ ant
Buildfile: build.xml

BUILD FAILED
/home/packwolf/Application/src/build.xml:12: The following error occurred while executing this line:
/home/packwolf/Application/src/nbproject/build-impl.xml:22: Class org.apache.tools.ant.taskdefs.condition.Not doesn't support the nested "antversion" element.

当我检查 build-impl.xml 时,它有一个用于检查 ANT 版本 1.7 或更高版本的 XML 块。如何使构建独立于ant版本?

提前致谢。

4

2 回答 2

3

A nested antversion task is allowed only 1.7 onwards so no way you can actually make this work with full functionality. This is what you can do as workaround though these are not solutions to the problem

  1. Comment out the ANT check in the build-impl.xml. Then run on an older version of ANT (say 1.6.5). This would stop the antversion check and the build will progress but without seeing the build.xml its not possible to comment where else it might fail.
  2. Install a newer version of ANT wherever the build is supposed to run.
于 2012-08-16T10:29:46.287 回答
1

您可以将 ant 签入到存储库并在操作系统中使用它而不是默认值。但是要运行ant,你需要java。您可以将 JRE 签入您的存储库,但在这种情况下,您的存储库将非常大。

于 2012-08-15T16:10:54.383 回答