如何配置 Eclipse 以在项目构建过程中自动刷新项目?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3943961/
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:12:08  来源:igfitidea点击:

How do I configure eclipse to automatically refresh a project as part of it's build?

javaeclipsebuild-process

提问by ScArcher2

I have a maven plugin generating some code for eclipse to build, but I have to manually refresh the project before eclipse sees the code.

我有一个 maven 插件,为 eclipse 生成一些代码来构建,但我必须在 eclipse 看到代码之前手动刷新项目。

How can I make eclipse automatically refresh the project as part of the build?

作为构建的一部分,如何让 Eclipse 自动刷新项目?

I'm trying to use a custom builder, but it wants to run a command (which I don't need to do).

我正在尝试使用自定义构建器,但它想运行一个命令(我不需要这样做)。

采纳答案by Avall

You can make eclipse automatically refresh your whole workspace: Window->Preferences->General->Workspace and check "Refresh automatically"

您可以让 Eclipse 自动刷新整个工作区:窗口->首选项->常规->工作区并选中“自动刷新”

回答by J-Dizzle

you can make it project/build specific for external builders under Project Properties->Build->Refresh Policy. Here is an example for C/C++ builds.

您可以在Project Properties->Build->Refresh Policy下使其项目/构建特定于外部构建器。这是 C/C++ 构建的示例。

enter code here

在此处输入代码

回答by Eugene Kuleshov

Depending on how you run your Maven plugin, it may just refresh the project automatically. That is how it normally works in m2eclipse.

根据您运行 Maven 插件的方式,它可能会自动刷新项目。这就是它在 m2eclipse 中的正常工作方式。

Also, you can configure a custom builder Project Properties / Builders / New... / Program and select some dummy command to run (e.g. C:\cygwin\bin\date.exe) and then configure project refresh settings.

此外,您可以配置自定义构建器 Project Properties / Builders / New... / Program 并选择一些要运行的虚拟命令(例如 C:\cygwin\bin\date.exe),然后配置项目刷新设置。