Maven – Intellij IDEA 15: Unindexed remote maven repositories found

gradleintellij-ideamaven

I created a Java Gradle project in IntelliJ IDEA 15.0.3. But I am getting the following error.

Unindexed remote maven repositories found. Disable...
        The following repositories used in your gradle projects were not indexed yet: 
        http://repo1.maven.org/maven2
        If you want to use dependency completion for these repositories artifacts,
        Open Repositories List, select required repositories and press "Update" button (show balloon)

When I open the repositories list and click update, I am getting the following error

java.lang.RuntimeException: java.io.IOException: Transfer for nexus-maven-repository-index.properties failed

Best Answer

In your build.gradle repositories section replace mavencentral() with another mirror, like so:

repositories {
    maven {
        url "http://uk.maven.org/maven2"
    }
}

then when you get the "Unindexed remote maven repositories found" go to the repositories view and press update. that should do it