Intellij-idea – IntelliJ IDEA: “Indexed Maven Repositories” list – how to REMOVE a remote maven repository in this list

intellij-ideamaven-2repository

I really wanted this to be a comment to the answer posted in the thread IntelliJ IDEA: "Indexed Maven Repositories" list – how to add remote maven repository in this list? but my reputation does not allow for it. So please excuse this being posted as a new Question.

Is there any way to remove a repository from the "Indexed Maven Repositories" list? I moved projects and still see my old repositories in there, some of which have actually been taken offline.

I have tried re-importing my settings.xml file, restarting IntelliJ multiple times(invalidating the cache too), but cannot get those repositories to go away from this list.

Best Answer

In my case the "indexed maven repository" I wanted to remove wasn't defined in Maven's settings.xml, but was defined inside one of my many sub-project's pom.xml file. I had to delete the following section from a pom.xml file. After deleting that from the pom.xml file the "indexed maven repository" was removed from Maven's settings in IntelliJ

<repositories>
    <repository>
        <id>foo</id>
        <name>foo</name>
        <url>file://${project.basedir}/maven/repository</url>
    </repository>
</repositories>