如何为 IntelliJ IDEA 项目禁用或启用 Gradle/Maven 自动导入? [英] How do I disable or enable Gradle / Maven auto-import for an IntelliJ IDEA project?

查看:46
本文介绍了如何为 IntelliJ IDEA 项目禁用或启用 Gradle/Maven 自动导入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无意中点击了链接以启用我正在处理的 Gradle 项目的自动导入.如何为当前项目禁用它?我发现的唯一选项是默认为所有项目禁用它.

我正在使用 IDEA 2017.1.

解决方案

自动导入是

2020.2+ 版本中,可以在设置(macOS 上的首选项)中配置自动重新加载行为 |构建、执行、部署 |构建工具 |更改构建脚本后重新加载项目:

2020.1.2 版本开始,有一个三态选项用于导入更改,它可用于 Gradle 和 Maven:

2020.1.1 版本中,您可以启用或禁用外部更改的自动重新加载(2020.1 中不存在该选项):

另请参阅

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.

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:

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:

Starting with 2020.1.2 version there is a 3-state option for importing changes, it's available for both Gradle and Maven:

In 2020.1.1 version you can enable or disable the automatic reload of the external changes (option not present in 2020.1):

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.


Before 2020.1 version you could disable it in Settings | Build, Execution, Deployment | Build Tools | Gradle | Use auto-import:

这篇关于如何为 IntelliJ IDEA 项目禁用或启用 Gradle/Maven 自动导入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆