Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
369 views
in Technique[技术] by (71.8m points)

How do I disable or enable Gradle / Maven auto-import for an IntelliJ IDEA project?

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.

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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:

Load Gradle Changes

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:

reload 1

reload 2

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

3-state option

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

Auto-reload external changes

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:

auto import


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...