Search code examples
javamavenintellij-idea

IntelliJ idea can't update any maven repositories


Problem:

I have a maven project that builds & compiles fine using maven tool from command-line.

Then I have IntelliJ IDEA that refuses to build said project, claiming that some of dependencies are not available.

I've found out that the root of the problem is in fact that IntelliJ can't connect to maven repositories which contain said dependencies. Of repositories, there are 3:

  1. apache's maven repo (https://repo.maven.apache.org/maven2)

  2. sonatype's oss repo (https://oss.sonatype.org/content/repositories/snapshots)

  3. company's internal repo (url omitted)

All three are available, accessible through browser for viewing, and dependencies from them are fetched using maven command line interface.

But, IntelliJ just says ".. can't reconnect" and shows errors about updating said repos. I've tried to use different maven options (my local installation, 3.5.2; intellij's bundled maven2 and maven3), to no avail yet.

Any idea why that could happened?


Solution

  • I have run into this many times also and the only solution that has worked is to restart IntelliJ which has worked every time.