如何禁用在 Eclipse 中构建项目?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4173788/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 15:20:01  来源:igfitidea点击:

How to disable building a project in Eclipse?

eclipse

提问by Jared

Is there some way to keep a project open in eclipse without building it?

有没有办法让项目在 Eclipse 中保持打开状态而无需构建它?

I have a few projects in eclipse that don't build because of errors. I just want to use them as reference while I edit and build my main project, however I can't run my main because eclipse complains about all the errors from the other projects (my project does not depend on them)

我在 Eclipse 中有几个项目由于错误而无法构建。我只想在编辑和构建主项目时将它们用作参考,但是我无法运行我的主项目,因为 eclipse 抱怨其他项目的所有错误(我的项目不依赖于它们)

回答by Tom H

It's possible to disable building all project automatically, but this is often overkill.

可以禁用自动构建所有项目,但这通常是矫枉过正。

Rather than disable all projects from building automatically, you can right click the problem project in the explorer and select the properties of the project. Then select the builders option, and deselect all the builders. This disables building of that particular project.

您可以在资源管理器中右键单击有问题的项目并选择项目的属性,而不是禁用所有项目的自动构建。然后选择构建器选项,并取消选择所有构建器。这将禁用该特定项目的构建。

In order to clear all the build problems that were previously logged by auto-building, you can got to "problems" or "Markers" tab, and select all and delete the items listed there, they will be recreated (except for your disabled project on the next rebuild)

为了清除之前由自动构建记录的所有构建问题,您可以转到“问题”或“标记”选项卡,然后全选并删除那里列出的项目,它们将被重新创建(除了您禁用的项目)在下一次重建)

回答by stacker

Uncheck 'Build automatically' in the projects menu.

在项目菜单中取消选中“自动构建”。

You could also filter the displayed errors/warnings for selected working-sets.

您还可以过滤所选工作集的显示错误/警告。

BTW: If your 'main' project is compiled (check bin or classes folder) you should be able to run it, regardless of other projects problems.

顺便说一句:如果您的“主”项目已编译(检查 bin 或 classes 文件夹),您应该能够运行它,而不管其他项目有什么问题。

回答by Joerg Moellendorf

You may want to unbind the Ctrl-B key.

您可能想要解除 Ctrl-B 键的绑定。

  • Go to Window -> Preferences -> General -> Keys
  • Mark Build allin the command list
  • press button Unbind Command
  • 转到窗口 -> 首选项 -> 常规 -> 键
  • 在命令列表中标记Build all
  • 按下按钮 Unbind Command

回答by aaiezza

Right-click and close a project you don't wish to build.

右键单击并关闭您不想构建的项目。

Since I normally work with tens of projects in Eclipse, I have grown to prefer closing project so that Eclipse knows to ignore them. Double clicking a project in the Project Explorer view will reopen it!

由于我通常在 Eclipse 中处理数十个项目,因此我越来越喜欢关闭项目,以便 Eclipse 知道忽略它们。在 Project Explorer 视图中双击一个项目将重新打开它!

More details: https://dzone.com/articles/quick-way-open-closed-project

更多详情:https: //dzone.com/articles/quick-way-open-closed-project