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

标签 eclipse ant build cruisecontrol

我在 Eclipse 中有一个项目,该项目目前没有 ANT 构建文件,但即将创建一个(以方便构建 jar)。我想编写构建文件,以便它对两者都适用。我正打算在 ANT 中编写完整版本,但我在 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.



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

最佳答案

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

在典型的开发过程中,您可能会更改 Java 源文件并希望看到它们编译。 Eclipse Java 编译器会处理这个问题。不太频繁地您需要重建 jar 。 Ant 会处理这个问题。当您需要从命令行或 Eclipse 时,您可以启动 Ant 构建。

关于eclipse - 创建 ANT 文件以在 Eclipse 和 CruiseControl 中使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6062960/

相关文章:

java - m2e如何判断项目是否具有java性质?

eclipse - 通过eclipse为Bazaar安装IDE eclipse插件

java - 如何让 Ant sshexec 使用非空密码

c# - 如何强制 VS 2010 跳过未更改的项目的 "builds"?

java - 如何让我的程序接受任意数量的数组而不是一组?

java - 类型 new MediaPlayer.OnCompletionListener(){} 必须实现继承的抽象方法

bash - 如何通过 bash 脚本检测来自 ant/maven 的构建错误?

ant - 如何在 Ant 的 basedir 路径中获取最后一个文件夹的名称?

android - 错误 :Execution failed for task ':app:mergeDebugResources' . > java.lang.ArrayIndexOutOfBoundsException(无错误消息)

android - 将自定义 ant 任务添加到我的 Android 项目中的 custom_rules.xml