且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何为IntelliJ IDEA项目禁用或启用Gradle/Maven自动导入?

更新时间:2022-06-11 18:23:04

自动导入为

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: