I use intellij 2017.3 ,it update local maven repository indices everytime I edit pom.xml no matter the dependency exists or not .It chokes the machine a lot .
By the way,in settings->maven->Reposities local show "Error"
Even I delete a dependency,it trigger background work:

- 924
- 1
- 9
- 23
-
See also http://stackoverflow.com/a/42427510/104891. – CrazyCoder Nov 08 '17 at 17:41
1 Answers
I suspect you are confusing the project's indices with the maven repository indices. When you update a POM file, IDEA will reimport the maven POM. That is, it will re-sync the IDEA project configuration to the POM's configuration. While doing this, it will index any new dependencies that are imported and thus update the project's indices. You will see this in the progress bar. However, it does not update the maven repository's indices.
You can configure IDEA to re-import the POMs automatically or manually upon being changed. For a quick change (adding a single new dependency for example), auto importing works well. But if you are heavily editing a POM file, using manual import might be better, especially on a less performant system. Make this setting in Settings > Build, Execution, Deployment > Build Tools > Maven > Importing > "Import Maven projects automatically". That will change it for the current project. To change the default for future new projects, make the setting in the same place under Settings > Other Settings > Default Settings > Build... Keep in mind that any changes to the POM (adding/removing/updating dependencies, etc) will not take effect in the IDEA project until you reimport it. You can do such either from the notification window indicating a reimport is needed, or from the maven tool window via the reimport button
If you are having performance issues here, you may want to increase the memory allocated to IntelliJ IDEA (assuming you have available memory on your system). See the Important Information section of on the Increasing Memory Heap help page. (I suspect this will solve your issue. Try giving it 2 or 3 Gigs if you have the RAM)
Repository Indices are only updated when you manually go into Settings, select a repository, and then click the "Update" button. (See the Maven Repositories help page). They do not get updated when you edit a POM (unless you add a <repository>
in which case an entry is made, but the indices are not updated until you click the button to do such.) The repository indices are used for auto-complete when editing the POM or doing a search for an artifact/dependency to add. Screenshots of two examples are below.
Your screenshot shows the error is happening with your local repository. The path shown is an unusual path. I have to assume you have set that via the <localRepository>
element in your settings.xml
file. I'd recommend clickinghte Update button. And then if/when it causes an error again, go to Help > Show Log in Explorer and see if there is any information in the log as to the issue. There may be some corruption in your repo or it's metadata file(s).
Examples of Auto-completion and Searching that uses the Maven Repository Indices

- 30,412
- 11
- 93
- 70
-
1、“confusing the project's indices with the maven repository indices” ,I observe the title in background task when I delete a dependency (please see my add picture) 2、thank your suggestion to watch the log ,"org.jetbrains.idea.maven.server.MavenServerIndexerException: Error scanning context Index0-update: MALFORMED" – yuxh Nov 09 '17 at 08:52