创建 ANT 文件以在 Eclipse 和 CruiseControl 中使用

发布于 2024-11-08 20:05:24 字数 569 浏览 0 评论 0原文

我在 Eclipse 中有一个项目,当前没有 ANT 构建文件,但即将创建一个(以方便构建 jar)。我想编写构建文件,以便它适用于两者。我正要在 ANT 中编写完整的构建,但我注意到 IBM 帮助文档

Java 构建器运行内部 Eclipse Java 编译器又是 负责索引您的来源 以便搜索、重构和 还有许多其他功能可用。 因此无法更换 内部 Eclipse Java 编译器 使用项目生成器。你可以 禁用 Java 构建器,您可以 控制 Java Builder 何时运行 关于项目建设者 您定义的。

我是否需要编写 ANT 文件,以便它仅在 Eclipse 外部有条件地编译 (javac)?我还需要做其他事情才能使 ANT 和 Eclipse 很好地协同工作吗?

I have a project in Eclipse that currently has no ANT build file, but is about to have one created (to facilitate building jars). I'd like to write the build file so that it would work for both. I was just going to write the full build in ANT but I noticed this line in an IBM Help doc.

The Java builder runs the internal
Eclipse Java compiler which in turn is
responsible for indexing your source
so that searching, refactoring and
many other features are available.
Thus it is not possible to replace the
internal Eclipse Java compiler by
using a project builder. You can
disable the Java builder and you can
control when the Java Builder runs
with respect to the project builders
that you define.

Do I need to write the ANT file so that it conditionally compiles (javac) only outside Eclipse? Are there other things I need to do to make ANT and Eclipse play nicely together?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

萌吟 2024-11-15 20:05:24

也许有更复杂的方法,但这对我有用。只需在 Eclipse 中设置 Java 项目,将类输出到与 Ant 构建文件相同的目录。让 Eclipse 使用普通的 Java 编译器来编译您的项目。

在典型的开发过程中,您可能会更改 Java 源文件并希望查看它们是否可以编译。 Eclipse Java 编译器会处理这个问题。您需要重建 jar 的频率会降低。蚂蚁会处理这个事情。当需要时,您可以从命令行或从 Eclipse 启动 Ant 构建。

There are maybe more sophisticated approaches, but here's what works for me. Just set up your Java project in Eclipse to output classes to the same dir as your Ant buildfile does. Let Eclipse compile your project using normal Java compiler.

During typical development, you will probably be changing Java source files and wanting to see that they compile. The Eclipse Java compiler will take care of this. Less frequently you will need to rebuild jars. Ant will take care of that. You can kick off the Ant build when you need to from the command line or from Eclipse.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文