问题描述
我无意间单击了链接以启用对正在处理的Gradle项目的自动导入.如何为当前项目禁用它?我发现的唯一选项是默认情况下对所有项目禁用它.
I inadvertently clicked the link to enable auto import of a Gradle project I was working on. How do I disable it for the current project? The only option I'm finding is for disabling it by default for all projects.
我正在使用IDEA 2017.1.
I'm on IDEA 2017.1.
推荐答案
自动导入为在编辑时默认禁用(并启用外部更改),并且在对构建文件进行更改后,构建文件编辑器的右上角会显示一个图标,因此您可以加载更改并执行导入:
Auto import is disabled by default while editing (and enabled for external changes) and an icon is displayed in the top right of the build file editor after you make changes to the build file so that you can load the changes and perform the import:
在 2020.2 + 版本中,可以在设置"(macOS上的首选项")中配置自动重新加载行为.构建,执行,部署|生成工具|更改构建脚本后重新加载项目:
In 2020.2+ versions automatic reload behavior can be configured at Settings (Preferences on macOS) | Build, Execution, Deployment | Build Tools | Reload project after changes in the build scripts:
从 2020.1.2 版本开始,有一个用于导入更改的三态选项,它适用于Gradle和Maven:
Starting with 2020.1.2 version there is a 3-state option for importing changes, it's available for both Gradle and Maven:
在 2020.1.1 版本中,您可以启用或禁用外部更改的自动重新加载(2020.1中不存在该选项):
In 2020.1.1 version you can enable or disable the automatic reload of the external changes (option not present in 2020.1):
另请参见相关功能请求,以使UI更加清晰很难注意到建议导入设置的小图标.
See also the related feature request to make the UI more obvious as it may be hard to notice a small icon suggesting to import the settings.
在2020.1版本之前,您可以在设置" |禁用"中禁用它.构建,执行,部署|生成工具|摇篮| 使用自动导入:
Before 2020.1 version you could disable it in Settings | Build, Execution, Deployment | Build Tools | Gradle | Use auto-import:
这篇关于如何为IntelliJ IDEA项目禁用或启用Gradle/Maven自动导入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!